User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MS Access and FileMaker Pro section within the Web Development category of DaniWeb, a massive community of 391,563 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,676 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS Access and FileMaker Pro advertiser:
Views: 1420 | Replies: 2
Reply
Join Date: Jul 2007
Posts: 13
Reputation: tashakota is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
tashakota tashakota is offline Offline
Newbie Poster

Query in VBA does not pull same results as normal query

  #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 11:00 am.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2007
Location: KSA
Posts: 147
Reputation: kb.net is an unknown quantity at this point 
Rep Power: 2
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

  #2  
Aug 22nd, 2007
Hi,

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

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

  #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 10:17 am.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb MS Access and FileMaker Pro Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the MS Access and FileMaker Pro Forum

All times are GMT -4. The time now is 10:05 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC