I am running Access 2003 and I just received this runtime error 3061. I have tried different quote structures in my strSQL statement with no luck. I was hoping to get some help.
The debug statement comes out like this: SELECT r.grp1 FROM dbo_rptq_rpts r INNER JOIN dbo_dic_Client c ON c.clid = r.clntid WHERE ((c.uci =AIS));
Tom
The debug statement comes out like this: SELECT r.grp1 FROM dbo_rptq_rpts r INNER JOIN dbo_dic_Client c ON c.clid = r.clntid WHERE ((c.uci =AIS));
Tom
Code:
strSQL = "SELECT r.grp1 " & _
"FROM dbo_rptq_rpts r " & _
"INNER JOIN dbo_dic_Client c ON c.clid = r.clntid " & _
"WHERE ((c.uci =" & (GetUCI(liCl)) & "));"
Debug.Print strSQL
Set rstORDER = CurrentDb.OpenRecordset(strSQL, dbOpenSnapshot)
If Not rstORDER.EOF Then
With rstORDER
.MoveLast
.MoveFirst
End With
End If
intGrp = rstORDER![grp1]
If intGrp = 1 Or intGrp = 3 Then strORDER = "ORDER BY dos,PatName;" 'Unapplied and Facility sorting order