I have a table that has multiple pID (patient Numbers)in a table called [Voucher Table 6 Codes], I have another table called [Voucher Table 6 Codes UDS]. I am trying to count the number of unique pID's in the first table and update the [...UDS] table with the number of pID's in a field called [UserCount]for a certain diagnosis [t6ID] for a certain calendar year. Here's my sql, which doesn't work cause it gives me all 0's.
PARAMETERS Forms![UDS Report Form]![UDSyr] Value;
UPDATE [Voucher Table 6 Codes UDS] SET [Voucher Table 6 Codes UDS].UserCount = DCount("*","[Voucher Table 6 Codes]","t6ID=" & [t6ID] & " AND DatePart('yyyy',[Date Issued])= " & [Forms]![UDS Report Form]![UDSyr]);
Any help is appreciated, I have way to much time in trying to figure this out already. Thanks
PARAMETERS Forms![UDS Report Form]![UDSyr] Value;
UPDATE [Voucher Table 6 Codes UDS] SET [Voucher Table 6 Codes UDS].UserCount = DCount("*","[Voucher Table 6 Codes]","t6ID=" & [t6ID] & " AND DatePart('yyyy',[Date Issued])= " & [Forms]![UDS Report Form]![UDSyr]);
Any help is appreciated, I have way to much time in trying to figure this out already. Thanks