UserForm Update on the Fly

  • Thread starter Thread starter Nigel
  • Start date Start date
N

Nigel

Using (xl97) I have a userform that opens after a user event to display some
data extracted from a worksheet. On this form is another control button
that is enabled (or not) depending on the state of the extracted data
displayed on the form.

If the control button on the first form is enabled and clicked a second form
opens allowing the user to change some data, which in turn affects the
values on the sheet being the same data used on the first form. Closing the
second form reveals the first form again but of course the data and the
state of the enabling button has not changed.

Is there anyway that the first form can dynamically change in response to
the users action on the second form?

I had thought about closing and re-opening following the second form close
event, but that seems a bit drastic and heavy handed.

TIA

Nigel
 
Nigel..

hide the original form instead of unloading it.
then your second form can access all the controls on the
first form.

'code for userform1
'this form has 2 textboxes and 1 commandbutton
Private Sub CommandButton1_Click()
Load UserForm2
UserForm2.TextBox1 = Me.TextBox1
Me.Hide
UserForm2.Show
End Sub


'code for userform2
'this form has 1 textbox and 1 commandbutton
Private Sub CommandButton1_Click()
'indirect reference for "on the fly controls"
UserForm1.Controls("TextBox2") = Me.TextBox1
Unload Me
UserForm1.Show
End Sub



keepITcool

< email : keepitcool chello nl (with @ and .) >
< homepage: http://members.chello.nl/keepitcool >
 
keepITcool

Thanks for the tip - of course hiding it releases the form !
It now works great

Cheers
Nigel
 

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