Query in VBA does not pull same results as normal query

Please support our MS Access and FileMaker Pro advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Jul 2007
Posts: 13
Reputation: tashakota is an unknown quantity at this point 
Solved Threads: 0
tashakota tashakota is offline Offline
Newbie Poster

Query in VBA does not pull same results as normal query

 
0
  #1
Aug 21st, 2007
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.
Last edited by tashakota; Aug 21st, 2007 at 12:00 pm.
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 160
Reputation: kb.net is an unknown quantity at this point 
Solved Threads: 26
kb.net's Avatar
kb.net kb.net is offline Offline
Junior Poster

Re: Query in VBA does not pull same results as normal query

 
0
  #2
Aug 22nd, 2007
Hi,

Please try to replace the True by 1. (Members.Member=1)
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 13
Reputation: tashakota is an unknown quantity at this point 
Solved Threads: 0
tashakota tashakota is offline Offline
Newbie Poster

Re: Query in VBA does not pull same results as normal query

 
0
  #3
Aug 23rd, 2007
Tnaks for the suggestion, but that did not work either. In fact the code would not execute with a 1 in there.
Last edited by tashakota; Aug 23rd, 2007 at 11:17 am.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 2861 | Replies: 2
Thread Tools Search this Thread



Tag cloud for MS Access and FileMaker Pro
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC