Run Append Query on Close Fore Procedure

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

Guest

I have a user database that requires an Append Query to be run everytime the
user closes a specific form.

Can someone guide me in writing the procedure for this?

I don't want the user to see any of the process.

Any help would be greatful.

Thanks.
 
hi,
In the form's on close event
docmd.openquery "queryname", accViewNormal

if it is as append query, the result will not show.
 
Okay, so I wrote the code into my on Close event procedure, but I have one
additional problem.

I'm still getting the confirmation message:

"Microsoft can't append all the records to the append query"

I want this to be automatic YES.

I've turned off all the confirmation messages for the actions queries using:

TOOLS
Options
Edit/Find
Confirm
removed check next to Action Queries.

But I still get the question mentioned above. I would like this to be
automatic so my users don't see any questions.

Thanks in advance for your continued help.
 
hi agian,
sorry i took so look to respond. I'm at work.
that message doesn't look like a confirmation message.
from reading it, it looks like an error message.
not sure what it's about but it seems to be stating that
it can't do something.
post your append query code.
 
Just before you run the Query, add
SetWarnings False

After the Query,
SetWarnings True

The SetWarnings False turns off Confirmation messages. What I do is set it
set all confirmation messages off for the application. I don't want users
dealing with them. To do this, from the Acces Menu:
Tools->Options Edit/Find Tab
Look under Confirm and uncheck all boxes. If you do this, you will not need
the SetWarnings.
 
Back
Top