Trying to Call Module and getting compiling error

mtrant

Registered User.
Local time
Today, 15:43
Joined
Aug 21, 2008
Messages
15
Hi,

I am trying to call my Autosave module from the Form_Open event. Everytime I open the database I get a compiling error.

Code:
Private Sub Form_Open(Cancel As Integer)
Call Autosave
End Sub

I have the form selected to "Has Module" and if I run the code from VBA it will prompt the macro box and I can run teh Autosave. But as soon as I start teh database I go right into a compiling error.

Any Ideas?


Matthew Trant,
The Eastern CT Business Consultants
 
From Access Help:
- The Open event occurs when a form is opened, but before the first record is displayed.
- The Load event occurs when a form is opened and its records are displayed.

It might be you are using some sort of 'save' but yet you do not have a record loaded, thus the error. You can experiment with trying to do it from the OnLoad event.

-dK
 
Thank you

Worked perfectly, thank you!
 

Users who are viewing this thread

Back
Top Bottom