How do you kick off a macro when opening a database

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

Guest

My DB seems to have lost this link (?) and my date update macro won't run
unless I do it manually. I didn't create this DB and can't find how they set
it up.
Any ideals would be approeciated.
DB opens to a switchboard with area forms(subforms)
Thanks
 
What is the name of the macro? It should be named Autoexec if you want it to
do something each time that the database is opened. Carefull here as an
Autoexec macro will run each time the database is opened and not just once a
day unless someone did a very good job.
 
thanks Jerry, I will look that up. I found where it is an event on the
Switchboard Form properties. Unfortunately it still doesn't work.
Any ideals why it should stop working after 10 monthes? I added a new table
and added the queries ect. And of course I added a line to this Macro. What
could I have done to screw this up?
 
if you were using SQL Server, it would be super easy to launch a
script on a scheduled basis

good luck
 
Acceess MDB is unreliable

you're probably runnning out of space or soemthing; MDB is bloatware
move to SQL Server
 
I need more information.

1. What does the event on the Switchboard form say? These are normal:
Private Sub Form_Open(Cancel As Integer)
' Minimize the database window and initialize the form.

' Move to the switchboard page that is marked as the default.
Me.Filter = "[ItemNumber] = 0 AND [Argument] = 'Default' "
Me.FilterOn = True

End Sub

Private Sub Form_Current()
' Update the caption and fill in the list of options.

Me.Caption = Nz(Me![ItemText], "")
FillOptions

End Sub

There are also FillOptions() and HandleButtonClick() subs that are suppose
to be there.

2. Any Autoexec Macros?

3. Go to Tools, Startup. What is listed under Display Form/Page? Is it
something different than Switchboard?

4. What macro do you run manually? How do you run it normally? How do you
know that it isn't working?

5. What tables and stuff did you add and where did you add it?

6. What does the macro do and what did you add? Post the code for the macro
by going to Macros on the Objects bar and clicking once on the macro. Next go
to File, Save As and change the drop down from Macro to Module. Say Ok and
then Convert. Next close the Macro then go over to Modules on the Objects
bar. You should see one named something like Converted Macro- TheMacroName.
Open it in design mode and post the code here.
 
Dear Jerry,
thanks for all those hints. I found out somehow my DB was opening on an old
Switchboard, with an old Macro attached, with an old sub form, that no longer
existed. I have no clue as to why this would happen. I am going to print your
response for further trouble shooting.
Thanks again.

Jerry Whittle said:
I need more information.

1. What does the event on the Switchboard form say? These are normal:
Private Sub Form_Open(Cancel As Integer)
' Minimize the database window and initialize the form.

' Move to the switchboard page that is marked as the default.
Me.Filter = "[ItemNumber] = 0 AND [Argument] = 'Default' "
Me.FilterOn = True

End Sub

Private Sub Form_Current()
' Update the caption and fill in the list of options.

Me.Caption = Nz(Me![ItemText], "")
FillOptions

End Sub

There are also FillOptions() and HandleButtonClick() subs that are suppose
to be there.

2. Any Autoexec Macros?

3. Go to Tools, Startup. What is listed under Display Form/Page? Is it
something different than Switchboard?

4. What macro do you run manually? How do you run it normally? How do you
know that it isn't working?

5. What tables and stuff did you add and where did you add it?

6. What does the macro do and what did you add? Post the code for the macro
by going to Macros on the Objects bar and clicking once on the macro. Next go
to File, Save As and change the drop down from Macro to Module. Say Ok and
then Convert. Next close the Macro then go over to Modules on the Objects
bar. You should see one named something like Converted Macro- TheMacroName.
Open it in design mode and post the code here.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


lovespar said:
thanks Jerry, I will look that up. I found where it is an event on the
Switchboard Form properties. Unfortunately it still doesn't work.
Any ideals why it should stop working after 10 monthes? I added a new table
and added the queries ect. And of course I added a line to this Macro. What
could I have done to screw this up?
 
T od o s Me no s [M S F T] said:
Acceess MDB is unreliable

you're probably runnning out of space or soemthing; MDB is bloatware
move to SQL Server


Note that this person is really A a r o n K e m p f and that he is not an employee
of Microsoft.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
note that tony is neither

MOST
VALUABLE
or a
PROFESSIONAL


anyone with a clue would have started using SQL Server a decade ago;
it is a completely superior platform in all regards-- with no
negatives

only a retard that can't learn a real database would ever use Access
MDB
I mean get real-- move to ADP or real VB-- either way, Access MDB is
dead and it has been for a decade





T od o s Me no s [M S F T] said:
Acceess MDB is unreliable
you're probably runnning out of space or soemthing; MDB is bloatware
move to SQL Server

Note that this person is really A a r o n K e m p f and that he is not an employee
of Microsoft.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems athttp://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog -http://msmvps.com/blogs/access/
 

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

Back
Top