L
Lori
I am trying to have a field on my form that counts the number of records with
an Active or Change of Ownership status code within a zip code/local agency
combination. The Change of Ownership criteria is something that I am adding
(my code was working when it was just counting the Active status records).
The first set of code below is worked with just one Status criteria, the
second set is what I am trying that doesn't work. I need to total of all
records with Active or Change of Ownership status. The code is off of the On
Current event:
This worked with just Active status:
If Me.DataEntry = False Then
Current_Vendor_Count = DCount("*", "tbl_Vendor", "(tbl_Zip_Code.Zip_Code =
tbl_Vendor.P_Zip_Code) AND (tbl_Zip_Code.Local_Agency_Code =
tbl_Vendor.Local_Agency_Code) AND [Status_Code] = ‘Active’ AND
[Peer_Group_Code] <> 11 ")
End If
This is the code where I tried to add a second Status criteria and it
doesn't count the records correctly (I'm not getting an error, just not the
correct count)
If Me.DataEntry = False Then
Current_Vendor_Count = DCount("*", "tbl_Vendor", "(tbl_Zip_Code.Zip_Code =
tbl_Vendor.P_Zip_Code) AND (tbl_Zip_Code.Local_Agency_Code =
tbl_Vendor.Local_Agency_Code) AND ([Status_Code] = 'Active' or [Status_Code]
= 'Change of Ownership/Inc in Process') AND [Peer_Group_Code] <> 11 ")
End If
Thanks for any help!
an Active or Change of Ownership status code within a zip code/local agency
combination. The Change of Ownership criteria is something that I am adding
(my code was working when it was just counting the Active status records).
The first set of code below is worked with just one Status criteria, the
second set is what I am trying that doesn't work. I need to total of all
records with Active or Change of Ownership status. The code is off of the On
Current event:
This worked with just Active status:
If Me.DataEntry = False Then
Current_Vendor_Count = DCount("*", "tbl_Vendor", "(tbl_Zip_Code.Zip_Code =
tbl_Vendor.P_Zip_Code) AND (tbl_Zip_Code.Local_Agency_Code =
tbl_Vendor.Local_Agency_Code) AND [Status_Code] = ‘Active’ AND
[Peer_Group_Code] <> 11 ")
End If
This is the code where I tried to add a second Status criteria and it
doesn't count the records correctly (I'm not getting an error, just not the
correct count)
If Me.DataEntry = False Then
Current_Vendor_Count = DCount("*", "tbl_Vendor", "(tbl_Zip_Code.Zip_Code =
tbl_Vendor.P_Zip_Code) AND (tbl_Zip_Code.Local_Agency_Code =
tbl_Vendor.Local_Agency_Code) AND ([Status_Code] = 'Active' or [Status_Code]
= 'Change of Ownership/Inc in Process') AND [Peer_Group_Code] <> 11 ")
End If
Thanks for any help!