hardhitter06
Registered User.
- Local time
- Today, 13:59
- Joined
- Dec 21, 2006
- Messages
- 600
Hi All,
I'm using Access 2003.
I have an input form with 5 fields. All 5 fields are required or the record will not save. Currently, I have a Save button from the Macro toolbar on this form. When it is clicked and if any of the fields are not filled out, a null message displays. The thing I want it to do is Save the record and also exit out of it if all the fields are entered. Obviously, if they are not filled out, i would like the button to give the null message and allow the user to fill in whatever they might have missed and then reclick the save button which will exit out of the form after the record has been saved.
Here is the code for this Macro button now, I don't know if I need more code or if there is an obvious fix.
Private Sub Command8_Click()
On Error GoTo Err_Command8_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Exit_Command8_Click:
Exit Sub
Err_Command8_Click:
MsgBox Err.Description
Resume Exit_Command8_Click
End Sub
Please let me know and thank you in advance.
Josh
I'm using Access 2003.
I have an input form with 5 fields. All 5 fields are required or the record will not save. Currently, I have a Save button from the Macro toolbar on this form. When it is clicked and if any of the fields are not filled out, a null message displays. The thing I want it to do is Save the record and also exit out of it if all the fields are entered. Obviously, if they are not filled out, i would like the button to give the null message and allow the user to fill in whatever they might have missed and then reclick the save button which will exit out of the form after the record has been saved.
Here is the code for this Macro button now, I don't know if I need more code or if there is an obvious fix.
Private Sub Command8_Click()
On Error GoTo Err_Command8_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Exit_Command8_Click:
Exit Sub
Err_Command8_Click:
MsgBox Err.Description
Resume Exit_Command8_Click
End Sub
Please let me know and thank you in advance.
Josh