User Forms - passing data between them

  • Thread starter Thread starter mickiedevries
  • Start date Start date
M

mickiedevries

I am trying to use user forms to build a program in excel. I would lik
it to use all user forms. When a certain item on one form is selecte
it calls another form. My problem is that I need to pass informatio
between the forms so I can total prices that are selected on th
multiple forms, I'm not sure how to pass this data between the forms.

Thank You for any suggestions.

Micki
 
hide the first form. the second form can then access the data

in userform1

Private Sub CommandButton1_Click()
me.hide
userform2.show
End Sub


in userform2

Private Sub CommandButton1_Click()
if Userform1.Combobox1.Value = "House" then
' do something
elseif Userform1.Combobox1.Value = "Dog" then
' do something else
end if
End Sub

as an example.
 
Thanks for the help, but how do I pass the information in a variable?

For instance when a radio button is selected on form1 an amount i
assigned to variable1 (but not shown on the form) and then form2 i
shown. I want form2 to be able to utilize variable1 from form1. I'
assuming I still have to hide form1 but how do I get the value fro
form1 I tried the following but it did not work:

UserForm1.Variable1.Value

Thanks Again,

Micki
 
If you make the variable public at the top of the userform code module, then
it should work.
 

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