BeforeUpdate problem with Multiple Page Form

W

William Wisnieski

Hello Everyone,

Access 2000

I have a form with multiple pages on it. There is one text field
[SupervisoryStatus] on the third page of the form that I need the user to
complete before leaving the form or moving to the next record.

So, in the BeforeUpdate event of the form itself I have the following code:

If Len(Me.SupervisoryStatus & "") = 0 Then
MsgBox "Please Indicate Supervisory Status."
DoCmd.CancelEvent
Me.SupervisoryStatus.SetFocus
End If

If this text field is blank and the user tries to leave the record or form,
it sends the user to the field so they can complete it. It works fine
except for one problem. If the user clicks on another page (clicks on the
tab) on the form, access thinks the user is trying to move to another record
so the BeforeUpdate event fires. I want the user to be able to move from
page to page without it firing, but I want it to execute if they actually
try to leave the form, or move to another record if the field is left blank.

This same problem occurs if I make the field a required field in the table.

Thanks for your help.

William
 

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