Public Function boxes(curday As Variant, curbox As Integer)
Dim dbs As Database
Dim rst As Recordset
Dim temp2 As Date
Dim strSQL As String
temp2 = (DateAdd("d", curbox, curday))
strSQL = "SELECT * INTO tblTemp1 FROM tblSummary1 WHERE ShipDate = #" & temp2 & "# OR BatchMakeDate = #" & temp2 & "# OR NYStdDate = #" & temp2 & "# OR NYMassDate = #" & temp2 & "# OR ComponentsDueBy = #" & temp2 & "#;"
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset(strSQL)
rst.MoveLast
If rst.RecordCount <> 0 Then
["D" & curbox].BackColor = "FF0000"
End If
End Function
Anybody know why I get an "invalid operation" message at the line
Set rst = dbs.OpenRecordset(strSQL) ? Catapultam habeo. Nisi pecuniam omnem mihi dabis, ad caput tuum saxum immane mittam.
Dim dbs As Database
Dim rst As Recordset
Dim temp2 As Date
Dim strSQL As String
temp2 = (DateAdd("d", curbox, curday))
strSQL = "SELECT * INTO tblTemp1 FROM tblSummary1 WHERE ShipDate = #" & temp2 & "# OR BatchMakeDate = #" & temp2 & "# OR NYStdDate = #" & temp2 & "# OR NYMassDate = #" & temp2 & "# OR ComponentsDueBy = #" & temp2 & "#;"
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset(strSQL)
rst.MoveLast
If rst.RecordCount <> 0 Then
["D" & curbox].BackColor = "FF0000"
End If
End Function
Anybody know why I get an "invalid operation" message at the line
Set rst = dbs.OpenRecordset(strSQL) ? Catapultam habeo. Nisi pecuniam omnem mihi dabis, ad caput tuum saxum immane mittam.