S
susan
Hello,
I get following (Access 2003) error on code below:
Error 3078. Jet-engine can't find table or query strSQL.
What do I do wrong?
Thanks,
Susan
AANT = "25"
strSQL = "SELECT TOP " & AANT & " " & _
" QVarHitsSel.hit, QVarHitsSel.titelschoon, QVarHitsSel.lokkaal, " & _
"QVarHitsSel.lokatie, QVarHitsSel.titel, QVarHitsSel.volg, " & _
"QVarHitsSel.mijnchceck, VarTrackSpecs.toegevoegd " & _
"FROM QVarHitsSel INNER JOIN VarTrackSpecs " & _
"ON QVarHitsSel.titel=VarTrackSpecs.titel " & _
"ORDER BY VarTrackSpecs.toegevoegd DESC;"
' MsgBox strSQL
' XXX -----------
Dim dbsHuidig1 As Database
Dim rs1 As Recordset
Set dbsHuidig1 = CurrentDb()
Set rs1 = dbsHuidig1.OpenRecordset("strSQL")
' rs1.MoveFirst
Do Until rs1.EOF
MsgBox rs1!titelschoon
rs1.MoveNext
Loop
rs1.Close
' XXX -----------
I get following (Access 2003) error on code below:
Error 3078. Jet-engine can't find table or query strSQL.
What do I do wrong?
Thanks,
Susan
AANT = "25"
strSQL = "SELECT TOP " & AANT & " " & _
" QVarHitsSel.hit, QVarHitsSel.titelschoon, QVarHitsSel.lokkaal, " & _
"QVarHitsSel.lokatie, QVarHitsSel.titel, QVarHitsSel.volg, " & _
"QVarHitsSel.mijnchceck, VarTrackSpecs.toegevoegd " & _
"FROM QVarHitsSel INNER JOIN VarTrackSpecs " & _
"ON QVarHitsSel.titel=VarTrackSpecs.titel " & _
"ORDER BY VarTrackSpecs.toegevoegd DESC;"
' MsgBox strSQL
' XXX -----------
Dim dbsHuidig1 As Database
Dim rs1 As Recordset
Set dbsHuidig1 = CurrentDb()
Set rs1 = dbsHuidig1.OpenRecordset("strSQL")
' rs1.MoveFirst
Do Until rs1.EOF
MsgBox rs1!titelschoon
rs1.MoveNext
Loop
rs1.Close
' XXX -----------