My table and form has the following fields
Rec_ID - Autonumber
Ser_No - Serial number generated when form is opened for data entry
2 text fields
When the user opens the form for data entry, Ser_No displays the next serial number. After filling up the text fields, the record gets saved when user closes the form. However, at times, the user opens the form and decides that data need not be entered. When he closes the form, a blank records is saved with the Rec_ID & Ser_No. I want to avoid this blank entry. So I put the following code at OnClose event of the form:
If Me.Field1 Is Null Or Me.Field2 Is Null Then
Cancel = True
Me.Undo
End If
This code is not working. Could someone help me with the code please?
Rec_ID - Autonumber
Ser_No - Serial number generated when form is opened for data entry
2 text fields
When the user opens the form for data entry, Ser_No displays the next serial number. After filling up the text fields, the record gets saved when user closes the form. However, at times, the user opens the form and decides that data need not be entered. When he closes the form, a blank records is saved with the Rec_ID & Ser_No. I want to avoid this blank entry. So I put the following code at OnClose event of the form:
If Me.Field1 Is Null Or Me.Field2 Is Null Then
Cancel = True
Me.Undo
End If
This code is not working. Could someone help me with the code please?