vba automate various processes

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Access VBA Training and help » VBA to automate various processes upon opening a database

VBA to automate various processes upon opening a database

resolvedResolved · Medium Priority · Version 2007

Mark has attended:
Access VBA course

VBA to automate various processes upon opening a database

Is there a way of setting a database to use Overlapping Windows and turn of the navigation pane (I would prefer not to do this every time I needed to create another database based on a template I have created). Also, how would I set a particular form to open automatically when the database is opened?

RE: VBA to automate various processes upon opening a database

Hi Mark,

Thank you for your question.

I am currently training on-site and will have a look at the question later today.

Regards

Simon

RE: VBA to automate various processes upon opening a database

Hi Mark, thanks for your query. When it comes to forms, it depends on whether you are talking about an Access database form or a VBA form. Treat an Access database form exactly the same as a Switchboard form, but use the statement frmMain.Show (for example) to show a VBA form.

As for how to trigger it off automatically, this ties into your first point about setting application properties such as Overlapping Windows from the word go. A full explanation is beyond the scope of this forum, but essentially, you need to create an AutoExec subroutine. This is not as simply as it is in Excel or Word VBA but an outline of how to do so can be found here:

http://www.vb123.com/toolshed/05_map/ch04_autoexec.htm

Simon has worked out the line of code needed to switch off Overlapping Windows (it is a particularly obscure line of code) and this statement will need to go into the AutoExec subroutine. I'll get him to post it as soon as he is free.

I hope this helps. Let us know how you get on.

Anthony

Wed 9 Jun 2010: Automatically marked as resolved.

 

Training courses

 

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Access tip:

Random sampling

Data is th key to a good database, therefore checking is essential.

A good way of checking data is by random sampling. You can do this in a query, by typing the follow:
1) In the Field box create a RandonID field eg. Randon Id: Rnd(fieldname])

2) sort the field
3)Right click and chage the properties for To value to be the number of randon records you want to see.

4) Change the set to Show row for Randon ID to be False, add all the other fields you want to see and the run the query.

View all Access hints and tips


Server loaded in 0.07 secs.