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

reading a value from a control on a form

Status
Not open for further replies.

progressive7

Technical User
Jul 25, 2002
33
GB
i have written a bit of code that find the name of every object on a form. i want to then read the value of that object if it is one that holds data e.g. combo,text,list box.

because the code is being run from a module i need to map to the object i want to read I.E

ValueWanted =forms!form1!text7.text
but the problem is that the name of the field is in a variable such as CTLFieldName how do i use the contents of the variable to retrive the value from the control

any help would be grateful accepted
 
Try:
[tt]ValueWanted =forms("form1")(CTLFieldName).value[/tt]

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top