Dcount using 2 criteria for Field 1 and field 2
Hi team, I was hoping the guru's on this site can help me plz.
I have a Dcount which needs to check 2 fields and it works, but when i add a second criteria to field 1 it returns an incorrect result or shows an error#.
System used:
Access: 2010
This is used in a Userform> Control Source
Field 1 should [mty] = "990" or "996" (Source in short text type)
and field 2 should look for "2. Afternoon Shift"
Returns a correct result, but only checks field 1 for criteria 1 and field 2 for criteria 1.
DCount("[ID]","[tbl_UpdatedRawData]","[MTy]=" & Chr(34) & "990" & Chr(34) & "AND [Typ] =" & Chr(34) & "RW1" & Chr(34) & " AND [Shift] =" & Chr(34) & "2. Afternoon Shift" & Chr(34))
Returns a incorrect results when i add a second criteria to field 1.
DCount("[ID]","[tbl_UpdatedRawData]","[MTy]=" & Chr(34) & "990" & Chr(34) & " Or [MTy] = " & Chr(34) & "996" & Chr(34) & "AND [Typ] =" & Chr(34) & "RW1" & Chr(34) & " AND [Shift] =" & Chr(34) & "2. Afternoon Shift" & Chr(34))
Hi team, I was hoping the guru's on this site can help me plz.
I have a Dcount which needs to check 2 fields and it works, but when i add a second criteria to field 1 it returns an incorrect result or shows an error#.
System used:
Access: 2010
This is used in a Userform> Control Source
Field 1 should [mty] = "990" or "996" (Source in short text type)
and field 2 should look for "2. Afternoon Shift"
Returns a correct result, but only checks field 1 for criteria 1 and field 2 for criteria 1.
DCount("[ID]","[tbl_UpdatedRawData]","[MTy]=" & Chr(34) & "990" & Chr(34) & "AND [Typ] =" & Chr(34) & "RW1" & Chr(34) & " AND [Shift] =" & Chr(34) & "2. Afternoon Shift" & Chr(34))
Returns a incorrect results when i add a second criteria to field 1.
DCount("[ID]","[tbl_UpdatedRawData]","[MTy]=" & Chr(34) & "990" & Chr(34) & " Or [MTy] = " & Chr(34) & "996" & Chr(34) & "AND [Typ] =" & Chr(34) & "RW1" & Chr(34) & " AND [Shift] =" & Chr(34) & "2. Afternoon Shift" & Chr(34))
Last edited: