View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
eBob.com[_2_] eBob.com[_2_] is offline
external usenet poster
 
Posts: 12
Default Accessing Form's Values from Invoking Sub

Writing my first ever VBA macro. My macro needs to access the value which
the user typed into a text box on a form.

UserInput.Show
MsgBox "max value is " + UserInput.tbxMax.Text

The resulting message box shows that UserInput.tbxMax.Text returned a null
(or maybe blank) value but I certainly did type something into the text box!

The form's OK button's code just does an Unload Me. Is that the problem.
Are the control's values lost because of the Unload? If so what should I
have done to remove the display of the form and return control to the
invoking sub but still retain the user entered values?

I don't know that what I tried should have worked, but it all made sense
based on my VB.Net experience.

Thanks, Bob