Append query

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

Guest

Hi,
I have set up several append queries. Is it possible to set to run them
through switchboard. So far I can not find this option.
Thanks
 
If you are using the built in switchboard, yes. You will need to create a
Function (not a sub) in a standard module. One of the switchboard options is
to "Run Code". You would call this function from the switchboard. In the
function, you would execute your queries. You could even set them up as a
Transaction so that if any of them fails, they'll all be rolled back
(undone).

To execute the queries in the function:
Dim db As DAO.Database
Set db = CurrentDb
db.Execute "qryMyQuery1", dbFailOnError
db.Execute "qryMyQuery2", dbFailOnError
Set db = Nothing
 
Thanks.
For some reason I am getting
Compile Error:
Invalid outside procedure
and it highlights
Set db

I am not sure what to do.
 
Verify that you have a Reference set for DAO. In the code editor go to
Tools|References and make sure there is a check next to "Microsoft DAO 3.6
Object Library", although I would have expected the DIM statement to fail if
it wasn't there.

Where did you put the code?
 

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