Automatic validation on update query

Bakta

Registered User.
Local time
Today, 07:58
Joined
Aug 23, 2004
Messages
26
Hello,

In one of my forms, I use a boolean value (check-box) which I'd like to set as false as the form open. To do this I made a query and use it as opening statement in the form :

"
Private Sub Form_open ()

Dim stDocName as string

stDocName ="Reset_Action"
DoCmd.Openquery stDocName,acNormal,acEdit
"

Where Action is my boolean, and Reset_Action an update query which set it as false. It works like charm.

The problem, even if minor, is, for this form, I'd like to have the validation box not to appear so the user doesn't have to hit ok as the form opens.

So far, I've looked into the Openquery help and saw no lead which would point out to a possible way.

I'm starting to think I have to write down few more lines to emulate key pressing "ok" as many times as required, but don't know where to look at.

Any pointers appreciated.
 
You can switch to DAO and use the .execute method to run the query or you can turn warnings Off just before running the query and turn them back on immediately after. This is CRITICAL. If you forget to turn warnings back on, Access will stop prompting you to save things when you close objects without saving them. When I set warnings Off, I always turn the hourglass on. That gives me a visual clue that warnings are off just in case, I don't turn them back on (and turn hourglass off of course).
 
thx for the help, the hourglass tip is a good idea.
 

Users who are viewing this thread

Back
Top Bottom