PC Review


Reply
Thread Tools Rate Thread

Dlookup with Inner Join

 
 
stickandrock
Guest
Posts: n/a
 
      7th Mar 2009
I need to do a count on nbr of records retrieved from a dlookup query.

Table 1
Donor ID
Group ID

Table 2
Group ID (Relationship to Table 1 - Group ID)
Group Name
Group Category

I am attemping to do a count on Table1 (Donor ID) where Table2 (Group Name)
is = to "Mission" and I am just not sure how to code the inner join to Table
2

Any and all input would be greatly appreciated.....
 
Reply With Quote
 
 
 
 
Jeanette Cunningham
Guest
Posts: n/a
 
      7th Mar 2009
Hi stickandrock,
create a saved query based on both tables.
Use the fields DonorID and GroupName in the query.
Here's sample code based on a query called qCountDonorGroup

Dim lngCount as Long
Dim strCriteria as String

If Len(Me.GroupName) > 0 Then
strCriteria = "[GroupName] = 'mission'"
lngCount = DCount("*", "qCountDonorGroup", strCriteria)
End If

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia


"stickandrock" <(E-Mail Removed)> wrote in message
news80BF3E4-67CA-4C9D-964D-(E-Mail Removed)...
>I need to do a count on nbr of records retrieved from a dlookup query.
>
> Table 1
> Donor ID
> Group ID
>
> Table 2
> Group ID (Relationship to Table 1 - Group ID)
> Group Name
> Group Category
>
> I am attemping to do a count on Table1 (Donor ID) where Table2 (Group
> Name)
> is = to "Mission" and I am just not sure how to code the inner join to
> Table
> 2
>
> Any and all input would be greatly appreciated.....



 
Reply With Quote
 
stickandrock
Guest
Posts: n/a
 
      7th Mar 2009
Jeanette:

Thanks for this solution.... I was not aware that you could reference a
query in a lookup such as that.....

Your solution has made me a smarter programmer and that not easy for an
individual with a screen name of "stick and rock" haha....

have a great day.

"Jeanette Cunningham" wrote:

> Hi stickandrock,
> create a saved query based on both tables.
> Use the fields DonorID and GroupName in the query.
> Here's sample code based on a query called qCountDonorGroup
>
> Dim lngCount as Long
> Dim strCriteria as String
>
> If Len(Me.GroupName) > 0 Then
> strCriteria = "[GroupName] = 'mission'"
> lngCount = DCount("*", "qCountDonorGroup", strCriteria)
> End If
>
> Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
>
>
> "stickandrock" <(E-Mail Removed)> wrote in message
> news80BF3E4-67CA-4C9D-964D-(E-Mail Removed)...
> >I need to do a count on nbr of records retrieved from a dlookup query.
> >
> > Table 1
> > Donor ID
> > Group ID
> >
> > Table 2
> > Group ID (Relationship to Table 1 - Group ID)
> > Group Name
> > Group Category
> >
> > I am attemping to do a count on Table1 (Donor ID) where Table2 (Group
> > Name)
> > is = to "Mission" and I am just not sure how to code the inner join to
> > Table
> > 2
> >
> > Any and all input would be greatly appreciated.....

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sortable form with join or dlookup Claire Microsoft Access Forms 1 12th Sep 2009 02:53 AM
Re: Dlookup function - copying the dlookup info into a field.... Douglas J. Steele Microsoft Access Forms 0 6th Dec 2006 02:05 PM
dlookup syntax on self join =?Utf-8?B?dHVya2V5?= Microsoft Access Queries 3 22nd May 2006 04:27 PM
Dlookup over two join tables? =?Utf-8?B?U2hhcm9uSW5HYQ==?= Microsoft Access Form Coding 1 23rd Nov 2005 02:58 AM
Join Queries - can you join two tables with similar records, not an exact match? John Goodrich Microsoft Access Queries 1 15th Sep 2004 07:24 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:42 PM.