T
Todd
I've got a dbase form and then a subform where I have an incrementing record
number that increments each record entered and then starts back over at 1
when a new year starts. Basically, when you enter a submission date for a
record it will save the record with the next higher number. Below is the
code I entered in the subforms BeforeUpdate event:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull(Me!AEID) = True Then
Me!AEID = Nz(DMax("AEID", "tblequipmentdatatable", "Year(submissiondate)
=
Year(Forms!selectmanufacturerform!equipmentdataentryform.Form!submissiondate)"), 0) + 1
End If
This code works fine. In the same dbase I'm wanting to add a separate table
with different forms from above and have it do the same thing. I changed the
applicable field, table, and form names to apply to the new stuff but when I
add a record the incrementing number field always shows the number 1 and
doesn't go to 2, 3, 4, etc when new records are entered.
Any idea what I could be doing wrong?
number that increments each record entered and then starts back over at 1
when a new year starts. Basically, when you enter a submission date for a
record it will save the record with the next higher number. Below is the
code I entered in the subforms BeforeUpdate event:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull(Me!AEID) = True Then
Me!AEID = Nz(DMax("AEID", "tblequipmentdatatable", "Year(submissiondate)
=
Year(Forms!selectmanufacturerform!equipmentdataentryform.Form!submissiondate)"), 0) + 1
End If
This code works fine. In the same dbase I'm wanting to add a separate table
with different forms from above and have it do the same thing. I changed the
applicable field, table, and form names to apply to the new stuff but when I
add a record the incrementing number field always shows the number 1 and
doesn't go to 2, 3, 4, etc when new records are entered.
Any idea what I could be doing wrong?