Passing userForm values to other userForms

C

Chris

I have created two userForms and would like to pass text
box values (dates) between the two forms. The second
form opens when the user moves to a text box where I want
to place the information from the second form. When the
second form opens, I create a Public variable and then
assign it the value the user puts in the second form's
text box. When the second form is close I (try) to assign
the public variable value to the first forms text box.
(txtbox2 = varPublic) I have also tried the forms
collection to assign the value (txtbox2 =
frmMyForm1.txtbox1.value). I know that I must be missing
something... Anyone have suggested resources that I should
look to for the answer? Thanks in advance.

Chris
 
J

Jonathan West

Hi Chris,

It would help to see the code you have tried so far. But I suspect that you
don't need a public variable at all. I guess from your description that
frmMyForm1 remains open while the second form is displayed. Assuming that to
be true, assinging a value should be a simple matter of a line of code like
this

frmMyForm1.txtbox1 = txtbox2

where txtbox2 is a textbox in the second form. That line of code should be
run from within the second form as a part of the process of closing.

--
Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
 

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

Top