G
Guest
I have a command button in a form that creates a new Work Order. I would
like it to add 1 to the highest number in the table, i.e., our Work Orders
are numbered W-100, W-101, etc. I have tried placing the following code in
the BeforeUpdate event procedure, but nothing happens when I use the command
button. Does the DMax() code have to be placed within the command button
code? Also, does the "#" sign in my table/field names have an affect on the
codes?
If IsNull(Me![tblwoWorkOrder#]) Then
Me![tblwoWorkOrder#] = Nz(DMax("[tblwoWorkOrder#]", "tblWorkOrder#"), 0)
+ 1
End If
Thanks!
like it to add 1 to the highest number in the table, i.e., our Work Orders
are numbered W-100, W-101, etc. I have tried placing the following code in
the BeforeUpdate event procedure, but nothing happens when I use the command
button. Does the DMax() code have to be placed within the command button
code? Also, does the "#" sign in my table/field names have an affect on the
codes?
If IsNull(Me![tblwoWorkOrder#]) Then
Me![tblwoWorkOrder#] = Nz(DMax("[tblwoWorkOrder#]", "tblWorkOrder#"), 0)
+ 1
End If
Thanks!