Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I AutoExec more than one query when opening a database? 1

Status
Not open for further replies.

JBuckley2000

Vendor
Oct 27, 2000
58
US
Hey everyone,

I was just wondering if I would be able to have more than one query or form run when I open my database? In the beginning, I just want to have a form run when I opened a database, but now I will be needing to also run a few update queries when I start to refresh the data on the record table. I need to do this because I will be adding an ID Number through the form and I want its word description to just also pop up in the record table. As of now, I am doing this by running several different queries for each different IDNumber. Thanks and have a good day!

Jason Facey
 
Well if you open your autoexec macro in design view you will notice there a lot of blanks lines below the oNe(s) you have now.
Just put whatever you want below what you have.

Note: that it runs from top down so it will do whatever you have put down.


DougP, MCP
dposton@universal1.com

Ask me how Bar-codes can help you be more productive.
 
Hey Doug,

Thanks for replying and as you can see I am so rusty on Access, I couldn't even figure that out. Really simple and thanks for pointing that out to me.

One last question---is there a way to do AutoExec when I am closing the database so I can refresh the info I just entered on my records? If not, doing it at the beginning is fine also. Thanks for listening.

Jason
 
If you loo at the properties for a form then you can run a macro (or a bit of code) that will do what ever you want (update records etc) when the form is closed. Its not he same as when the database closes but it might well be OK for u.
 
You could call a macro through code (or just do whatever it is you need to do in code) and attach that to your "Exit Application" button. As long as they use the button, it would work. But if they hit the Close Window "X" box, it wouldn't work.


Terry M. Hoey
th3856@txmail.sbc.com

Ever notice that by the time that you realize that you ran a truncate script on the wrong instance, it is too late to stop it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top