General information
Title:
Access CrossTab query
Dear All,
I am trying to open a recordset from a crosstab query which I build using a FoxPro Link table in Access. The name of the query is concentrat_Crosstab1.
When I try to open a recordset from that crosstab query, I get a 'Type Mismatch' error. Following is the code I am using to open a recordset.
Dim MyDB As Database
Dim RS As Recordset
Dim QD As QueryDef
dim MyVar as string
Set MyDB = DBEngine(0).OpenDatabase("C:\DB\DataQC.mdb")
Set QD = MyDB.QueryDefs("concentrat_Crosstab1")
'I am getting an error on the following line.
Set RS = QD.OpenRecordset(dbOpenDynaset)
While Not RS.EOF
MyVar = rs!FieldName
Wend
Any help will be greatly appreciated.
Thanks.
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only