I have created a database from an excel file, one of the columns (PK) is the license number however this is in text format XX/XX/XXXX
When a new record is created I would like the form to auto-populate the license number field with a similar ID containing both text and numbers. This has to be incremented with every new record (only the number part)
This is exactly what I want to achive however I am getting the error shown below; https://www.youtube.com/watch?v=kPz-n5w5YtE
Any help would be appreciated, I have experience with VB however I am familiar with other programming languages.
If your idea is to take a number (8) and convert it to "0008", as in the comment above the error, try like this:
strNextNumber = Format(lngNextNumber, "0000")
or see the whole code:
Public Sub TestMe()
Dim strNextNumber As String
Dim lngNextNumber As Long
lngNextNumber = 8
strNextNumber = Format(lngNextNumber, "0000")
Debug.Print strNextNumber
End Sub