Run Update Query in silently in background

G

ghadley_00

I have a MS access 200 DB in which I have an update query which
repalces all the " " with ''" in a field. I would like the update query
to run in the background, and not ask the user for any perrmissions. I
was thinking to run the query as part of the autoexec macro.

can anyone recommend a way that I can have the update query run in the
background? I don't see an obvious way to set the SetWarnings command
for the query.

Any help would be greatly appreciated.

Best wishes,

George
[email protected]
 
J

Jeff Boyce

"run in the background" ... once, once each day, every hour, every minute,
?how frequently?

You could use either a procedure or a macro to:

* turn the warnings off
* run the query
* turn the warnings back on
 
G

ghadley_00

Thank you for the response. Was thinking of having the query run once
per user session (either when they started the database or closed it).
Any suggestions on how to do what you are suggesting would be greatly
appreciated.

Thanks.

George
 
J

Jeff Boyce

George

If you create a macro named "Auto" (or something like that ... sorry, I've
not used macros in a while), it will run "automatically" when the
application opens.
 
F

Frederick Wilson

Thank you for the response. Was thinking of having the query run once
per user session (either when they started the database or closed it).
Any suggestions on how to do what you are suggesting would be greatly
appreciated.

Thanks.

George

**The code provided is air code and to be used as and example or
starting point.

If you have a form that loads when the application opens you can try the
following.

in the on open function of the main form use this code.

on error goto err_trap

docmd.setwarnings false
docmd.runsql "Your Query Name Here"
docmd.setwarning true

err_trap_exit:
docmd.setwarning true 'Turn warnings back on in event of error.
Exit Sub

err_trap:
YOUR ERROR HANDLING HERE
resume err_trap_exit


--
Frederick Wilson

_____________________________________
for multimedia design services visit
http://www.legalanimatics.com
 
Top