form closes after error message

G

GinTonic

I don't understand why the entry form closes after I click OK. Form's Before
Update code is as follows:

On Error GoTo ProcError

If Len(Me.LastName & vbNullString) = 0 Then
Msgbox "Last name is required", vbOKOnly
Me.LastName.SetFocus
Cancel = True
End If

ExitProc:
Exit Sub

ProcError:
the usual.....

TIA,
Gin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top