ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pass value from form to form (https://www.excelbanter.com/excel-programming/337055-pass-value-form-form.html)

Harley

Pass value from form to form
 
How do i pass a value from code written for an option button to code for a
command button? I am running an auto open macro that shows userform1 with 2
command buttons, one of which that shows userform3, which has 16 option
buttons. I want to pass a string back after one of the 16 options is
selected. I am using xl97 and windows NT. I should also mention that I have
just begun to noodle around with forms, I've previously been able to get by
with input and message boxes.

TIA

Jim Thomlinson[_4_]

Pass value from form to form
 
When the user is finished updating the option buttons then you just need to
hide the form. The form and all its values are still accessible, you just
can't see the form. So in Form 2 you could write a line such as

msgbox userform3.optionbutton1.value

which will display the value of the option button on the hidden form. So you
are not so much passing the values as you are just accessing the values.
--
HTH...

Jim Thomlinson


"Harley" wrote:

How do i pass a value from code written for an option button to code for a
command button? I am running an auto open macro that shows userform1 with 2
command buttons, one of which that shows userform3, which has 16 option
buttons. I want to pass a string back after one of the 16 options is
selected. I am using xl97 and windows NT. I should also mention that I have
just begun to noodle around with forms, I've previously been able to get by
with input and message boxes.

TIA


Harley

Pass value from form to form
 
I now understand, thank you. If I unload the form, rather than hide it, are
the values still available?

"Jim Thomlinson" wrote:

When the user is finished updating the option buttons then you just need to
hide the form. The form and all its values are still accessible, you just
can't see the form. So in Form 2 you could write a line such as

msgbox userform3.optionbutton1.value

which will display the value of the option button on the hidden form. So you
are not so much passing the values as you are just accessing the values.
--
HTH...

Jim Thomlinson


"Harley" wrote:

How do i pass a value from code written for an option button to code for a
command button? I am running an auto open macro that shows userform1 with 2
command buttons, one of which that shows userform3, which has 16 option
buttons. I want to pass a string back after one of the 16 options is
selected. I am using xl97 and windows NT. I should also mention that I have
just begun to noodle around with forms, I've previously been able to get by
with input and message boxes.

TIA


Bob Phillips[_6_]

Pass value from form to form
 
No, unload clears out memory. If you do this, you need to off-load the
values somewhere else.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Harley" wrote in message
...
I now understand, thank you. If I unload the form, rather than hide it,

are
the values still available?

"Jim Thomlinson" wrote:

When the user is finished updating the option buttons then you just need

to
hide the form. The form and all its values are still accessible, you

just
can't see the form. So in Form 2 you could write a line such as

msgbox userform3.optionbutton1.value

which will display the value of the option button on the hidden form. So

you
are not so much passing the values as you are just accessing the values.
--
HTH...

Jim Thomlinson


"Harley" wrote:

How do i pass a value from code written for an option button to code

for a
command button? I am running an auto open macro that shows userform1

with 2
command buttons, one of which that shows userform3, which has 16

option
buttons. I want to pass a string back after one of the 16 options is
selected. I am using xl97 and windows NT. I should also mention that I

have
just begun to noodle around with forms, I've previously been able to

get by
with input and message boxes.

TIA





All times are GMT +1. The time now is 06:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com