Open the same form

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

Guest

Win Xp. Access 2003.

Normally I open a form and when it loads (in Load Event) i made some changes
via openargs:
(Docmd. Openform "frmAny",,,,,,"New")

If I open the form declaring a variable ...

Private frmFormInst1 as Form frmAny
Set frmFormInst1= New frmAny
With frmFromInst1
.Visible=true
end with

... I could not pass the openargs argument, becouse in the Set instruccion
the load event executes...

How can i do it?
Thanks
 
ToniMaura said:
Win Xp. Access 2003.

Normally I open a form and when it loads (in Load Event) i made some changes
via openargs:
(Docmd. Openform "frmAny",,,,,,"New")

If I open the form declaring a variable ...

Private frmFormInst1 as Form frmAny
Set frmFormInst1= New frmAny
With frmFromInst1
.Visible=true
end with

... I could not pass the openargs argument, becouse in the Set instruccion
the load event executes...

How can i do it?
Thanks

Normally, the argument is passed from the first form to the second, like so

DoCmd.OpenForm stDocName, , , , , , Me.Text0

Then in the receiving forms Load event you would have

Me.Text1 = Me.OpenArgs

Where Text0 and Text1 are text boxes on forms 1 and two respectively.
 

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