Open second form after first form

T

Thomas Kroljic

I would like to open a second form (not a subform) after the main form
opens. The second form will use a text data field from the first form.

Can I use VBA code within the first form to tell me when the form is
completely display and then load the second form? Or do I create a separate
piece of code that first opens form 1 and then opens form 2?

Thank you,
Thomas J. Kroljic
 
J

John Nurick

Hi Thomas,

I'd try using code in the first form's Current event procedure to open
the second form; by that stage the data in the first form's controls
should be available. Something like this air code:

Static blNotFirstTime

If Not blNotFirstTime Then
'do this only the first time the Current event runs
DoCmd.OpenForm "frmSecondForm"
DoEvents
blNotFirstTime = True
End If
 

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

Top