Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

check for Null entries in form

Status
Not open for further replies.

tekila

Programmer
Apr 18, 2002
150
SG
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?
 
My first guess would be that you should replace

Cancel = True

with

Exit Sub

Give that a shot.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top