I'm learning it slowly, but getting there!
When a user clicks the save button on my form the bit of code below will check for empty fields and show a msgbox if the textboxes are empty. That all works fine, but, it appears that a record is being created in my table if i say only one field is completed. I need some help to stop this happening.
All fields must be completed before a record is created. ideas please? Cheers
Private Sub save_rec_Click()
PART.SetFocus
If IsNull(PART) Then
MsgBox " Please enter a Part"
PARTNUMBER.SetFocus
elseIf IsNull(DESCRIPTION) Then
MsgBox "Please enter a Description"
DESCRIPTION.SetFocus
ElseIf [QUANTITY] < 1 Then
MsgBox "Please enter a Quantity"
QUANTITY.SetFocus
End If
'DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
End Sub
When a user clicks the save button on my form the bit of code below will check for empty fields and show a msgbox if the textboxes are empty. That all works fine, but, it appears that a record is being created in my table if i say only one field is completed. I need some help to stop this happening.
All fields must be completed before a record is created. ideas please? Cheers
Private Sub save_rec_Click()
PART.SetFocus
If IsNull(PART) Then
MsgBox " Please enter a Part"
PARTNUMBER.SetFocus
elseIf IsNull(DESCRIPTION) Then
MsgBox "Please enter a Description"
DESCRIPTION.SetFocus
ElseIf [QUANTITY] < 1 Then
MsgBox "Please enter a Quantity"
QUANTITY.SetFocus
End If
'DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
End Sub