>> Open form then run code

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

Guest

Hi, in Access 97 I have a form with progress bars. I want to open the form
and then automatically run code.

How do I have the form open and all the controls visible before running the
code (and not require a user to click a button)?

Using the OnOpen and OnLoad events trigger the code before displaying the
form.

Many thanks

Jonathan
 
Technique that I have used for this:

Private Sub Form_Open(Cancel As Integer)
Me.TimerInterval = 1
End Sub

Private Sub Form_Timer()
Me.TimerInterval = 0
Your automatic code here
End Sub

This allows the form to open but needs a very fast user to get in before the
code runs!

If you want to update the form from your code I have found that
Me.Repaint
is needed to get the update displayed.

HTH
John
 

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

Similar Threads


Back
Top