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!

How do I do an Excel's indirect function in Access?

Status
Not open for further replies.

ShaneBrennan

Programmer
May 19, 1999
198
GB
This is not easy to explain but I wish to extract information from a table, using a variable which holds the name of the field I wish to extract information from.

For example if I want to extract information from the Field StudentID I can use the following line:

Label3.Caption = rst![StudentID]

If I have a variable called FldName which = "StudentID" is there someway of producing a line of code similar to the following:

Label3.caption = indirect("rst![",FldName,"]")

Thanks for any help

Shane Brennan - Learning access - but very slowly!

Shane Brennan
Shane.Brennan@tcat.ac.uk

 
Try this:

Label3.Caption = rst(fldname)
where fldname is the name of the field in string form e.g. "StudentID"

Missy Ed
Looking to exchange ideas and tips on VB and MS Access development as well as office 97 development. Drop me a line: msedbbw@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top