Hi All,
I’m presently working with code very nicely supplied to me by Pat for assigning an invoice number to an invoice. I have a field on frmBilling called InvoiceNo. When frmBilling loads the code is as follows:
Dim dbs As DAO.Database, rs As DAO.Recordset, lngInvoiceNo As Long
Set dbs = CurrentDb
Set rs = dbs.OpenRecordset(“Control”)
rs.Edit
rs!NextAvailableInvoiceNo = rs!NextAvailableInvoiceNo + 1
lngInvoiceNo = rs!NextAvailableInvoiceNo
rs.Update
TextInvoiceNo = lngInvoiceNo
The form opens fine, however there are two problems. InvoiceNo has a zero in it and the next number in the table should be a 2. When I go to save the invoice I get the following error:
“user-defined type not defined” and ……dbs As DAO.Database….. is hightlighted in yellow.
I’m outta my leaque with this one and not sure where to go next.
Thanks,
Leesha