Accessing Form's Values from Invoking Sub

E

eBob.com

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
 

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