jrobin5881
Technical User
I have a invoice app that I created in Access a long time ago. It creates a work ticket that is given to the mechanic to take out the job. The tickets are pre-numbered and the FORM in Access was originally developed to mirror the form number incrementally by 1. For example the next hardcopy form number is 19979 in Access in the Invoice Number field I would expect the default value for the Invoice Number to keep pace with the hard copy and it has been working well for years. Now for some reason it stopped. As stated before the next number is 19979 and Access has it as 318513 In the InvoiceID field.
The properties for this field are as follows:
Control Source: Customer.InvoiceID Default Value: =GetNextInvoice()
In VBA I have the following code
Public Function GetNextInvoice()
'get next free Invoice Number
GetNextInvoice = Nz(DMax("[InvoiceID]", "[Customer]") + 1, 1)
End Function
I looked back into the table and the last number in the InvoiceID field is 19978 (the girls are typing each one in instead of accepting the default value) so I would expect the default value to increase by one as it's written but it's not. Like I said it has the crazy number that it's selecting on its own and I can't correlate to any other field in the tables
Any help here????
The properties for this field are as follows:
Control Source: Customer.InvoiceID Default Value: =GetNextInvoice()
In VBA I have the following code
Public Function GetNextInvoice()
'get next free Invoice Number
GetNextInvoice = Nz(DMax("[InvoiceID]", "[Customer]") + 1, 1)
End Function
I looked back into the table and the last number in the InvoiceID field is 19978 (the girls are typing each one in instead of accepting the default value) so I would expect the default value to increase by one as it's written but it's not. Like I said it has the crazy number that it's selecting on its own and I can't correlate to any other field in the tables
Any help here????