0

In vba, I've created a recordset called 'rs' that includes a field named "EmployeeName" and another named "Position". If I execute

ThisWorkbook.Worksheets("Contact").Cells(row, 1) = rs("EmployeeName")

it works fine, but if I instead do

ThisWorkbook.Worksheets("Contact").Cells(row, 2) = rs("Position")

I get an error "Item cannot be found in the collection corresponding to the requested name or ordinal." Run-Time error 3265

I'm pretty sure this is because "Position" is a reserved word, but I don't know a work-around.

Ben
  • 20,038
  • 30
  • 112
  • 189

1 Answers1

0

rs("Employees.Position"), where Employees is the name of my table, did the trick.

Ben
  • 20,038
  • 30
  • 112
  • 189