Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying public array variable in text box 2

Status
Not open for further replies.

JesOakley

Programmer
Jan 21, 2008
42
GB
Hi guys, no doubt i'm being entirely dense, but in a module I have 'Public fred(9) string' and then on a form I have 10 textboxes with the control source being fred(0) to fred(9). I don't understand why i'm getting #name? in the boxes when i run the form.

Anybody care to put me straight?
Any advice appreciated.
 
You can set the text boxes to a function that returns the relevant value.
 
Thanks for the prompt reply Remou. I've tried setting the control source on a text box to '=fred', but that didn't work. I thought the '=' forced it to act as a function. Is this is not the right way to do it?
 
You'd need to have a function in your VBA code that calls the public variable, and then set the text box equal to that function. I believe that is what Remou is saying.

--

"If to err is human, then I must be some kind of human!" -Me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top