NauticalGent
Ignore List Poster Boy
- Local time
- Yesterday, 19:48
- Joined
- Apr 27, 2015
- Messages
- 6,337
So I am really stumped on this one. Attached is a scaled-down version of a DB I inherited. The main form (not included) is based on a query that is determined by the user's position (EmployeeType, 1-5) and BuyerCode.
If the EmployeeType is 1 or 2, then show only the records that match their BuyerCode
If the EmployeeType is 3, then show all the records that match the first 4 characters of their BuyerCode
If the EmployeeType is 4, then show all the records that match the first 3 characters of their BuyerCode
If the EmployeeType is >= to 5 then show all the records
I made a Standard Module to build the criteria for the "qryGetBuyer" query but it only works for BuyerCode 1 and 2 - everything else returns no records. What is even more baffling (to me anyway!) is that I can copy-n-paste the Debug.Print statement into the query grid and it returns the correct record set.
I am obviously overlooking something simple but I have tried everything short of sacrificing my dogs at midnight.
Can somebody please save my pets?
If the EmployeeType is 1 or 2, then show only the records that match their BuyerCode
If the EmployeeType is 3, then show all the records that match the first 4 characters of their BuyerCode
If the EmployeeType is 4, then show all the records that match the first 3 characters of their BuyerCode
If the EmployeeType is >= to 5 then show all the records
I made a Standard Module to build the criteria for the "qryGetBuyer" query but it only works for BuyerCode 1 and 2 - everything else returns no records. What is even more baffling (to me anyway!) is that I can copy-n-paste the Debug.Print statement into the query grid and it returns the correct record set.
I am obviously overlooking something simple but I have tried everything short of sacrificing my dogs at midnight.
Can somebody please save my pets?