Stang70Fastback
Registered User.
- Local time
- Today, 17:23
- Joined
- Dec 24, 2012
- Messages
- 132
I'm having trouble trying to get one snippet of code to function properly, and end up with the error in the title of this thread.
I would have thought it would be an error in the query statement, but if I create a new query using what I wrote, it works just fine and pulls that one record. So now I don't know what's wrong. :banghead:
Any thoughts?
Option Compare Database
Private Sub Report_Load()
If (TempVars!ShowBuses) Then
DoCmd.SetProperty "txtBus", acPropertyVisible, "-1"
Else
DoCmd.SetProperty "txtBus", acPropertyVisible, "0"
End If
Dim rs As Recordset
Dim strSQL As String
strSQL = "SELECT FixedRoutes.[Shift Description] FROM FixedRoutes WHERE (((Left([FixedRoutes].[Shift Description],3))='11B'))"
Set rs = CurrentDb.OpenRecordset(strSQL)
If rs.RecordCount > 0 Then
MsgBox "This is a full service weekday!"
End If
End Sub
I would have thought it would be an error in the query statement, but if I create a new query using what I wrote, it works just fine and pulls that one record. So now I don't know what's wrong. :banghead:
Any thoughts?
Last edited: