Hello,
Can anyone help with this problem I am having with a form. On this form I currently have several text boxes on the form & also I have a save button. when I click save if the text boxes contain NULL then I want to display a message box saying that they need to eneter data in them. the [event procedure] is under the save button click_event. The code is shown below
Private Sub saveRecord_Click()
On Error GoTo Err_saveRecord_Click
If IsNull(txtJobDetailsStaffNo) Then
GoTo Err_saveRecord_Click
Else
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Exit Sub
Err_saveRecord_Click:
MsgBox "You must enter data in this field", vbCritical, "Data requested"
End If
End Sub
The problem is when you ENTER a value it still displays the msgbox & I dont want that, when data is in the text box I would like it to save.
Any ideas?
Thanks
Can anyone help with this problem I am having with a form. On this form I currently have several text boxes on the form & also I have a save button. when I click save if the text boxes contain NULL then I want to display a message box saying that they need to eneter data in them. the [event procedure] is under the save button click_event. The code is shown below
Private Sub saveRecord_Click()
On Error GoTo Err_saveRecord_Click
If IsNull(txtJobDetailsStaffNo) Then
GoTo Err_saveRecord_Click
Else
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Exit Sub
Err_saveRecord_Click:
MsgBox "You must enter data in this field", vbCritical, "Data requested"
End If
End Sub
The problem is when you ENTER a value it still displays the msgbox & I dont want that, when data is in the text box I would like it to save.
Any ideas?
Thanks