OK, so now that I have a recordset I'd like to get the values out of it, but something is going wrong.
Here's the SQL string and the corresponding code and error:
I get an error "Item Not Found in this Collection" on the debug.print line for "Value". It errors out on the third loop when the absoluteposition is equal to two. There are definitely six separate records in the table, however (and this might be the problem) the values in the field 'TagName' are exactly the same, but the values in "StepTagName" differ. Autonumber is used as the primary key for this table.
How do I fix this? Do I need to include the autonumber field in the SQL statement in order to pull out all the records? Why is that?
Thanks in advance,
Onwards,
Q-
Here's the SQL string and the corresponding code and error:
Code:
strSQLSource = "SELECT TagName, StepTagName FROM tblStepActions"
strSQLSource = strSQLSource & " WHERE TagName = " & "'" & Me.TagName & "'"
'Then I have a loop to look at the data:
Do While Not rsTag.EOF
Debug.Print "AbsPos :" & rsTag.AbsolutePosition
Debug.Print "Value :" & rsTag(rsTag.AbsolutePosition).Value
rsTag.MoveNext
Loop
I get an error "Item Not Found in this Collection" on the debug.print line for "Value". It errors out on the third loop when the absoluteposition is equal to two. There are definitely six separate records in the table, however (and this might be the problem) the values in the field 'TagName' are exactly the same, but the values in "StepTagName" differ. Autonumber is used as the primary key for this table.
How do I fix this? Do I need to include the autonumber field in the SQL statement in order to pull out all the records? Why is that?
Thanks in advance,
Onwards,
Q-