Refere to Columns in a table as a no.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi Thanks in advance.

Using 3.6 DAO is it possible to refer to each column in a recordset as a no
ie.

rs1 = db.OpenRecordset("tbl Directory Info")

firstCol = rs1!Column(1)
secCol = rs1!Column(2)

etc.

Regards

Trev
 
Recordsets have Fields, not Columns, so you'd use:

firstCol = rs1!Fields(0)
secCol = rs1!Fields(1)

Note that the Fields collection starts at 0, not 1.
 
Back
Top