Run a query on load

amfroehlich

Board Regular
Joined
Jul 14, 2004
Messages
192
I have a append Query that I want to run everytime the access database is opened.

What would the code be for this and where can i put it?

Thanks :p
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Put it on the form you load when the db opens on the "On Open" event

you can us code like this

docmd.openquery "yourappendqueryname"

You may want to set the warnings off or you will be prompted that you are going to append records to a table to do that:

DoCmd.SetWarnings False
docmd.openquery "yourappendqueryname"
docmd.setwarnings true
 
Upvote 0

Forum statistics

Threads
1,221,792
Messages
6,161,997
Members
451,735
Latest member
Deasejm

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top