Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

multiple forms

  Asked By: Kiswar    Date: Nov 05    Category: MS Office    Views: 513
  

I want to create a form that requests data and then opens another form
populated with certain data from the spreadsheet dependent upon the
data entered into the first form, but the second form doesn't recognize
the variable from the first form. How can I fix this?

Share: 

 

3 Answers Found

 
Answer #1    Answered By: Logan Bouchard     Answered On: Nov 05

Is the variable  declared a Public variable or just in a procedure?

 
Answer #2    Answered By: Aidyn Smith     Answered On: Nov 05

I'm pretty new at this, so I may have done
it wrong, but I made it a public variable  in the first form. "Public
x as integer."

 
Answer #3    Answered By: Abbad Akhtar     Answered On: Nov 05

What I would do, is Hide the first user form  until I had gotten my values
out of it.

For instance, behind the click button of the first form:

Private Sub CommandButton1_Click()
Me.Hide
UserForm2.Show
End Sub

Then in the second UserForm,

Private Sub UserForm_Initialize()
UserForm2.TextBox1.Value = UserForm1.TextBox1.Value
Unload UserForm1
End Sub

 
Didn't find what you were looking for? Find more on multiple forms Or get search suggestion and latest updates.




Tagged: