field--barcode
type is string
the default value is "n288826830000"
I would like to make it autogenerate when I input new books via the form and not as a primary key
thus when I enter a book, the barcode should be
n288826830001, which has the ability +1 from the default value.
I have attempt to dmax the field in load as follows:
Expand|Select|Wrap|Line Numbers
- Private Sub Form_Open(Cancel As Integer)
- Dim strmax As Long
- strmax = DMax("Barcode", "books") + 1
- Me.Barcode.Value = strmax
- End Sub
I know that it should be a number before I can strand the last digit and add one,
how about add one to the text, how could this be done ?
thanks.