Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing information to multiple instances of a form 1

Status
Not open for further replies.

newfrontiers

Programmer
Oct 17, 2001
134
0
0
US
Hello. I have been struggling for two days now trying to figure out how to open multiple instances of a form and pass information to each.

As an example, I would like three of the same form opened and editable that have information for customer A, B and C, respectively. Is there an OpenArgs I can use for instances? I keep getting an error when trying this but maybe I'm doing something wrong.

Is there anyway of sending the customer number to the form?

The form has several subforms. Does that complicate things?

Thanks for any help you can provide.

 
I am not sure of your problem since you do not provide what you have tried, but here is a simple example.

I pop open three of the same form and Fill in text box "TextO" with the name of the form.
Code:
Option Compare Database
  Dim frmA As Form_frmOne
  Dim frmB As Form_frmOne
  Dim frmC As Form_frmOne

Public Sub createFormInstances()
  Set frmA = New Form_frmOne
  frmA.Text0.Value = "Form A"
  frmA.Visible = True
  
  Set frmB = New Form_frmOne
  frmB.Text0.Value = "Form B"
  frmB.Visible = True
  
  Set frmC = New Form_frmOne
  frmC.Text0.Value = "Form C"
  frmC.Visible = True
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top