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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

txtBox reference

Status
Not open for further replies.

matrixknow

IS-IT--Management
May 3, 2007
78
0
0
I have a dummy question. I have a sub in a module and I need the value of a Textbox. However how should I do this correct ?
Code:
strPath = Forms!Main.txtPath.Value
not ok
Code:
strPath = Forms!Main!txtPath.Value
not ok

He sais Main does not exist, in the form tab he is listed and in the properties I can't find a name. He use a different caption for the form.
 
How are ya matrixknow . . .

I perfer [blue]Forms!Main!txtPath[/blue]. You don't need value as its the default property for most controls . . .

Calvin.gif
See Ya! . . . . . .

Be sure to see FAQ219-2884:
 
Obviously, txtPath is a TextBox in an open main form named Main ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Ok, I should first say open to the form.
The code is in my module and as you guest not behind my form.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top