chrismid259
09-16-2011, 03:39 AM
Hi,
I have a form with a combo box that holds 7 options. What I want to be able to do is when nothing is entered and the save button on the form is clicked, a message box displays asking the user to select a value from the combo box.
So far, I've got this but it doesn't seem to be working. Anyone know what I'm doing wrong?
Private Sub cmdSave_Click()
On Error GoTo Err_cmdSave_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Exit_cmdSave_Click:
Exit Sub
If Combo88.Text = "" Then
MsgBox ("Please enter a value.")
End If
Err_cmdSave_Click:
MsgBox Err.Description
Resume Exit_cmdSave_Click
Any help would be appreciated.
Thanks.
I have a form with a combo box that holds 7 options. What I want to be able to do is when nothing is entered and the save button on the form is clicked, a message box displays asking the user to select a value from the combo box.
So far, I've got this but it doesn't seem to be working. Anyone know what I'm doing wrong?
Private Sub cmdSave_Click()
On Error GoTo Err_cmdSave_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Exit_cmdSave_Click:
Exit Sub
If Combo88.Text = "" Then
MsgBox ("Please enter a value.")
End If
Err_cmdSave_Click:
MsgBox Err.Description
Resume Exit_cmdSave_Click
Any help would be appreciated.
Thanks.