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

Dynamic Recordet 1

Status
Not open for further replies.

TimTDP

Technical User
Feb 15, 2004
373
ZA
In Access 2000, I want to refer a recordset dynamically

for example:
Set rst = dbs.OpenRecordset(TableName)
AAA = field name - field name is set elsewhere and this is the dynamic piece of code

With rst
intDataValue = rst!AAA

I get an error "item not found in this collection.

What is the correct syntax?
 
dim F as string
dim db as dao.database
dim rs as dao.recordset

f="field"
set db=currentdb
set rs=db.openrecordset("tablename")

yourvar=rs.fields(f)


I tried to have patience but it took to long! :) -DW
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top