can someone help with the syntax of the where clause. i am summing the hours worked per craft but on the last if statement is need to sum the total of several craftid's together.
Code:
Dim t As Date
Dim a As Date
Dim c As Date
If Not IsNull(DLookup("hours", "workquecraftt", "WorkQueID=" & [WorkQueID] & "and craftid=4")) Then
t = DSum("Hours", "workquecraftt", "WorkQueID=" & [WorkQueID] & "and craftid=4")
txttotal4 = t
Else
txttotal4 = 0
End If
If Not IsNull(DLookup("hours", "workquecraftt", "WorkQueID=" & [WorkQueID] & "and craftid=5")) Then
a = DSum("Hours", "workquecraftt", "WorkQueID=" & [WorkQueID] & "and craftid=5")
txttotal5 = a
Else
txttotal5 = 0
End If
If Not IsNull(DLookup("hours", "workquecraftt", "WorkQueID=" & [WorkQueID] & " and craftid=1,2,3,6 ")) Then
c = DSum("Hours", "workquecraftt", "WorkQueID=" & [WorkQueID] & " and craftid=1,2,3,6 ")
txttotalcont = c
Else
txttotalcont = 0
End If
im getting a runtime error 3075 on the last if statement where i have the 1,2,3,6