Form freezes in AfterUpdate Event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Using WinXP and Access 2002

In the AfterUpdate Event on a main form I have a simple statement:

'Me.ZZZZZ is a checkbox


If me.strXXXX = "YYYYY" then
Me.ZZZZZ = true
End IF

This works; the check box has a check mark, but the form freezes. I can not
go forward, backward, save, etc. All I can do is close the form and get the
error messages that nothing will be saved, etc.

Thanks for any help.
 
You have put Access into a tight loop. That's why the form freezes. The
AfterUpdate event runs AFTER the record has been saved. You are dirtying
the record in the AfterUpdate event which causes the record to be saved
again and then the AfterUpdate event runs and you dirty the record again.

Move the code to the form's BeforeUpdate event to solve the problem.
 

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

Similar Threads


Back
Top