Pulling my hair out because I can’t figure this out. I’ve done this at least 5 times before and can’t figure out what the error is. Here is the entire Block of code:
Private Sub Command7_Click()
Dim EquipNum As String
Dim JobNum As Integer
Set EquipNum = Combo2.Value
Set JobNum = Combo4.Value
Queries!qryHasHubMeterReading.SQL = “SELECT tblDailyProduction.Equip, tblDailyProduction.Date, tblDailyProduction.JobNumber, tblDailyProduction.Crew, tblDailyProduction.Code, tblDailyProduction.Hours, tblDailyProduction.PENE1, tblDailyProduction.PENE2, tblDailyProduction.HUBMeter, tblDailyProduction.LoadCount, tblDailyProduction.AvgCYLoad ” & _
“FROM tblDailyProduction ” & _
“WHERE (((tblDailyProduction.Equip) = ‘” & EquipNum & “‘) And ((tblDailyProduction.JobNumber) = ‘” & JobNum & “‘) And ((tblDailyProduction.PENE1) 0) And ((tblDailyProduction.PENE2) 0) And ((tblDailyProduction.HUBMeter) Is Not Null And (tblDailyProduction.HUBMeter) 0)) ” & _
“ORDER BY tblDailyProduction.Equip, tblDailyProduction.Date;”
qryHubDistance.Open
End Sub
The error I’m getting is “Compile Error: Object Required”. It occurs on the line “Set EquipNum =…”.
If anyone can help and put an end to my misery, I would be SINCERELY grateful.
Thanks much!