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

Pointers. text field contains a pointer to the object, any thoughts? 1

Status
Not open for further replies.

Gzep

Programmer
Mar 8, 2001
46
AU
Hi.

Pointers. I have a text field that contains a pointer to the object, i am looking to get the value of the object, any thoughts?

eg: strTest = "Forms!frmSetup!txtSerial"

and if you look at the form frmSetup, in the box txtSerial it contains the string: "PM719"

using code to manipulate strTest, can i return "PM719"

I know I can do it, if I write my own .dll in c++...( but i'd rather not)

Gzep.
 
OK here is an idea. Instead of referring to a form's controls using the ! syntax, it is acceptable to use parentheses. This means that if you want to refer to "Forms!frmSetup!txtSerial" you can use the syntax Forms("frmSetup")("txtSerial").

Even better, you can use variables:

frmName = "frmSetup"
ctlName = "txtSerial"
Forms(frmName)(ctlName)

So if you can use some string functions to pull out the form name and the control name, then you can pass them and get the value in txtSerial.

Does that make sense?
Kathryn


 
G'day kathryn.

Thanks, I had already thought of that, but it will have to be a more robust parser that I really have time for, as the users will (probably) entering details into the table, and I have to be able to handle all sorts of crap. ;-)

OK, looks like the way to go though.

Gzep.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top