I'm using Access 2003. I'm get the compile error "Method or Data Member Not Found" when trying to loop through some embedded sql. I've done this a million times before so I'm not sure why the error is happening in this case.
Here's the sql statement:
Here where the error's happenning, when I try to msgbox the [site id]:
I can't see anything wrong. The only possible thing may have to do with selecting the Rec_ID in the query because its an autonumber and index, but can't figure out why that would matter?
Here's the sql statement:
Code:
strSQL = "SELECT d.Rec_ID, d.[Site ID] FROM tblStat"
Code:
Set rs = CurrentDb.OpenRecordset(strSQL)
TotalRecords = 1
If rs.BOF = True And rs.EOF = True Then
TotalRecords = 0
End If
If TotalRecords <> 0 Then
rs.MoveFirst
Do Until rs.EOF
MsgBox rs.[Site ID]
rs.MoveNext
Loop
End If
I can't see anything wrong. The only possible thing may have to do with selecting the Rec_ID in the query because its an autonumber and index, but can't figure out why that would matter?