J
Jan T.
Hi!
I have a form "Return_Material_Authorization" that generates a consecutive
RMA number and saves it to the RMA table. That assures that if another user
creates anRMA the RMA number is unique.
If a user does not fill the form or decides to exit without filling at least
4 fields (Customer_ID, Customer_Name, Customer_PO and Part_Number) I want the
record deleted so that all records are valid.
Here is a snippet of the code I use in BeforeInsert event of the form:
Private Sub Form_BeforeInsert(Cancel As Integer)
'Find next R_ Number
Me![RA_Number] = Format(DMax("[RA_Number]",
"[Return_Material_Authorization]") + 1, "00000")
'Write the record to disk immediately
Me.Dirty = False
End Sub
I have a form "Return_Material_Authorization" that generates a consecutive
RMA number and saves it to the RMA table. That assures that if another user
creates anRMA the RMA number is unique.
If a user does not fill the form or decides to exit without filling at least
4 fields (Customer_ID, Customer_Name, Customer_PO and Part_Number) I want the
record deleted so that all records are valid.
Here is a snippet of the code I use in BeforeInsert event of the form:
Private Sub Form_BeforeInsert(Cancel As Integer)
'Find next R_ Number
Me![RA_Number] = Format(DMax("[RA_Number]",
"[Return_Material_Authorization]") + 1, "00000")
'Write the record to disk immediately
Me.Dirty = False
End Sub