i am trying to open a strored query as a recordset using the following code so that i can loop through it basing other queries on the contents
Set Cnn = CurrentProject.Connection
Set Rst = New ADODB.Recordset
Set Rst.ActiveConnection = Cnn
Call Rst.Open("QRY_AgentsToSendDupeReport", Cnn, adOpenStatic)
the last line there is highlighted by the debugger with the error
'Invalid SqL statement expected INSERT, SELECT, DELETE....'
i copyed that code straight from a thread on this board
http://www.access-programmers.co.uk/forums/showthread.php?t=55486&highlight=ado+recordset+query+open
anyone know what i'm doing wrong?
Set Cnn = CurrentProject.Connection
Set Rst = New ADODB.Recordset
Set Rst.ActiveConnection = Cnn
Call Rst.Open("QRY_AgentsToSendDupeReport", Cnn, adOpenStatic)
the last line there is highlighted by the debugger with the error
'Invalid SqL statement expected INSERT, SELECT, DELETE....'
i copyed that code straight from a thread on this board
http://www.access-programmers.co.uk/forums/showthread.php?t=55486&highlight=ado+recordset+query+open
anyone know what i'm doing wrong?