J
Jelly''s
I've spent hours reading all the posts and searching google for Custom
Autonumber and I can't get my code to work... so please help.
I have built code which imports an excel file into a master temporary table
on a monthly basis. I have another table "Text1" which I will populate using
an append query (pulling some of the information from the Master table). I
then add additional information to "Text 1" using an update query. So at
this point, all of the records are in the "Text1" table and I need a number
generated from 1 to n in the custom number field [BITEM]. I managed to get
all of the bugs out but no numbers get inserted into the field.
Sub SequentialNumber3()
Dim BITEM As String 'I've tried this as Integer as well and it doesn't
work
Dim Text1 As String
BITEM = Nz(DMax("[BITEM]", "Text1")) + 1
End Sub
I've also used the following code, but it also didn't work. In addition,
with this code, I have to manually insert a "1" in the first record or I get
a Null value error:
Sub SequentialNumber()
Dim BITEM As Integer
BITEM = DMax("[BITEM]", "Text1") + 1
End Sub
What am I doing wrong?
Autonumber and I can't get my code to work... so please help.
I have built code which imports an excel file into a master temporary table
on a monthly basis. I have another table "Text1" which I will populate using
an append query (pulling some of the information from the Master table). I
then add additional information to "Text 1" using an update query. So at
this point, all of the records are in the "Text1" table and I need a number
generated from 1 to n in the custom number field [BITEM]. I managed to get
all of the bugs out but no numbers get inserted into the field.
Sub SequentialNumber3()
Dim BITEM As String 'I've tried this as Integer as well and it doesn't
work
Dim Text1 As String
BITEM = Nz(DMax("[BITEM]", "Text1")) + 1
End Sub
I've also used the following code, but it also didn't work. In addition,
with this code, I have to manually insert a "1" in the first record or I get
a Null value error:
Sub SequentialNumber()
Dim BITEM As Integer
BITEM = DMax("[BITEM]", "Text1") + 1
End Sub
What am I doing wrong?