Afternoon all,
I'm trying to get an invoice number field to auto generate the next number, keeping the format as "00000"
this is what I have, which gets the next number but drops the leading 0
invoice numbers are 04024, 04025 etc
any ideas how I keep the formatiing?
I'm trying to get an invoice number field to auto generate the next number, keeping the format as "00000"
this is what I have, which gets the next number but drops the leading 0
Code:
Private Sub Customer_AfterUpdate()
If Len(Me.[InvoiceNumber] & vbNullString) = 0 Then
Me.[InvoiceNumber] = (DMax("[InvoiceNumber]", "[tblInvoiceNumber]") + 1)
DoCmd.RunCommand acCmdSaveRecord
End If
End Sub
any ideas how I keep the formatiing?