Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 8th, 2004, 04:21 PM
Registered User
 
Join Date: Jul 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Startup in VBA

Hi all,

I've spent (wasted) a long time googling this subject to no avail, so I hope that someone can provide me with an answer. I want to execute some VBA code whenever my MS Access 2000 database is launched.

To be more specific, I don't want to put this code in the form-open event of the form that loads at startup. I want this routine to actually be called by Access (sort of like a database-open event). The problem is, I can't find the syntax for it anywhere.

Thanks in advance

 
Old July 8th, 2004, 05:15 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

You can use an AutoExec macro to run VBA Function procedures at startup.

1. Create a new macro.
2. Name it "AutoExec"
3. Set the AutoExec macro's RunCode action to the name of any public Function procedure you have defined in a VBA standard module (the RunCode action can't call Sub procedures).
4. Close your database and re-open it. The Function procedure code will run at startup.

HTH,

Bob


 
Old July 9th, 2004, 09:15 AM
Registered User
 
Join Date: Jul 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Exactly what I was looking for. Thanks much!:)






Similar Threads
Thread Thread Starter Forum Replies Last Post
initilize on startup poseidonG Apache Tomcat 1 September 25th, 2006 03:54 AM
startup options mjuliao Access 4 November 22nd, 2005 04:45 PM
How to create shortcut in Startup? Ioan VB How-To 3 May 18th, 2005 04:29 AM
Load jsp on startup nazneen Pro JSP 0 April 15th, 2004 10:41 AM
Form Startup Order NeilS21 Beginning VB 6 2 February 26th, 2004 05:44 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.