BrotherRob
New member
- Local time
- Today, 12:27
- Joined
- Sep 9, 2012
- Messages
- 3
All,
I have a table that stores email addresses. A client can have many email addresses but only one is selected as the default which is indicated by the boolean field 'DefaultFlag' being selected. I've created a query to do this using the query design method which works perfectly. But because I have to pass a variable into the query I've had to use SQL in VBA to achieve this. The problem that I have is that the same query doesn't work in VBA. It finds all records associated with the client but fails to pick up the default record even with the boolean field set to 'True'. Please see the attached text file
I can't understand why it won't work because it appears to be correct.
Thanks in anticipation of a response.
I have a table that stores email addresses. A client can have many email addresses but only one is selected as the default which is indicated by the boolean field 'DefaultFlag' being selected. I've created a query to do this using the query design method which works perfectly. But because I have to pass a variable into the query I've had to use SQL in VBA to achieve this. The problem that I have is that the same query doesn't work in VBA. It finds all records associated with the client but fails to pick up the default record even with the boolean field set to 'True'. Please see the attached text file
I can't understand why it won't work because it appears to be correct.
Thanks in anticipation of a response.