Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default User Forms - passing data between them

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

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default User Forms - passing data between them

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.

--
Regards,
Tom Ogilvy

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

Thank You for any suggestions.

Mickie


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default User Forms - passing data between them

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

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default User Forms - passing data between them

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

--
Regards,
Tom Ogilvy

"mickiedevries " wrote in
message ...
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 is
assigned to variable1 (but not shown on the form) and then form2 is
shown. I want form2 to be able to utilize variable1 from form1. I'm
assuming I still have to hide form1 but how do I get the value from
form1 I tried the following but it did not work:

UserForm1.Variable1.Value

Thanks Again,

Mickie


---
Message posted from http://www.ExcelForum.com/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing a range to a user defined function Gary Nelson Excel Discussion (Misc queries) 1 July 19th 07 04:22 PM
passing arrays to user defined functions ramki Excel Worksheet Functions 2 February 15th 06 08:34 AM
Using User forms to enter data into lists Saar Ben-Attar Excel Programming 1 May 5th 04 05:02 PM
PASSING DATA FROM USER FORM TO EXCEL SPREADSHEET No Name Excel Programming 12 January 7th 04 01:36 PM
Passing Text from User Form to Spreadsheet Betsy[_2_] Excel Programming 1 August 6th 03 02:33 AM


All times are GMT +1. The time now is 10:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"