Set rstDeps = CurrentDb.OpenRecordset("SELECT Members.OrgID, Members.ID, Members.Member, Members.PrimaryRep, Members.MembershipType " _
                & "FROM Members " _
                & "WHERE (Members.Member=True AND Members.OrgID=" & !OrgID & " AND Members.MembershipType='" & !MembershipType & "');")

This is my query in VBA in MSAccess. I just want the number of people that fall into those criteria and it SHOULD be 4. But this consistently pulls 6 records. If I run this same query in a normal query it pulls 4.

The 6 records include 2 Members.Member=False. Why would it pull them as well? I'm fed up with this and don't understand why this does not work.

Recommended Answers

All 2 Replies

Hi,

Please try to replace the True by 1. (Members.Member=1)

Tnaks for the suggestion, but that did not work either. In fact the code would not execute with a 1 in there.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.