I want to check for any null entry (in comboboxes and textboxes) in a form upon clicking "New Record" control and this was what I did to test out one combo:
Private Sub new_record_Click(Cancel As Integer)
If IsNull([Combo]) Then
MsgBox "You must enter a value."
Cancel = True
End If
On Error GoTo Err_new_record_Click
DoCmd.GoToRecord , , acNewRec
Exit_new_record_Click:
Exit Sub
Err_new_record_Click:
MsgBox Err.Description
Resume Exit_new_record_Click
End Sub
Then I received a error message that says "Event procedure declaration does not match description of event having the same name." What's that and how do I solve the problem?
Private Sub new_record_Click(Cancel As Integer)
If IsNull([Combo]) Then
MsgBox "You must enter a value."
Cancel = True
End If
On Error GoTo Err_new_record_Click
DoCmd.GoToRecord , , acNewRec
Exit_new_record_Click:
Exit Sub
Err_new_record_Click:
MsgBox Err.Description
Resume Exit_new_record_Click
End Sub
Then I received a error message that says "Event procedure declaration does not match description of event having the same name." What's that and how do I solve the problem?