VirginiaMan
MIS
Hi, I am having trouble with some ADO syntax in Access 2002 and wanted to get some feedback.
I am trying to create a multi-column index to use with a seek statement.
Here is what I have tried, to no avail!
I have two fields in my table that I want to create a recordset index for : "TCID", and "IMTH" (These are not fields in the primary key on the underlying table, if that makes a difference).
The seek seems to work fine when I use a single field name for the index such as:
rstAllReps.Index = "TCID"
and rstAllReps.Seek TCIDIndex, adSeekFirstEQ
I tried using an array such as:
rstAllReps.Index = Array("TCID", "IMTH")
or
SeekArray = Array("TCID", "IMTH")
and
rstAllReps.Index = SeekArray
I keep getting a "Type mismatch" error when I run this. Does anyone have an idea how I could set up a multicolumn index for a recordset, that I could use with Seek?
I am trying to create a multi-column index to use with a seek statement.
Here is what I have tried, to no avail!
I have two fields in my table that I want to create a recordset index for : "TCID", and "IMTH" (These are not fields in the primary key on the underlying table, if that makes a difference).
The seek seems to work fine when I use a single field name for the index such as:
rstAllReps.Index = "TCID"
and rstAllReps.Seek TCIDIndex, adSeekFirstEQ
I tried using an array such as:
rstAllReps.Index = Array("TCID", "IMTH")
or
SeekArray = Array("TCID", "IMTH")
and
rstAllReps.Index = SeekArray
I keep getting a "Type mismatch" error when I run this. Does anyone have an idea how I could set up a multicolumn index for a recordset, that I could use with Seek?