How to show data on a Form from 3 queries (1 Viewer)

atol

Registered User.
Local time
Yesterday, 23:48
Joined
Aug 31, 2007
Messages
64
Hello folks,
This is probably no brainer for most of you, but I got stuck.
Basically I have created a few queries (some of them just show a number, let's say "total number of active clients, etc). I have a few queries producing similar results; I want to show all those results on one form; so you would have one form showing data from multiple queries... not sure if this is doable, but one thing I notices is that if I use unbound combo or list box, I would use the "Row Source" in "Properties" and link to the respective query; however there is no "Row Source" in a Text Box...so what do I do here? Any help is appreciated!
P.S. I did spend a good amount of time searching the forum, but did not come accross similar case...

Thanks again.
Atol
 

CEH

Curtis
Local time
Today, 01:48
Joined
Oct 22, 2004
Messages
1,187
Try creating one query that contains all your fields you need. A form (and underlying query) should contain fields that in some way relate to each other. For example.... say a animal clinic... You would not have a form used for entering information about dogs that contains information about birds.... You would use another form for your birds. My first thought would be to look at how your tables relate.
A textbox has a "Control Source" If not.... you have an empty textbox.
 

atol

Registered User.
Local time
Yesterday, 23:48
Joined
Aug 31, 2007
Messages
64
Got it. I will try to create such a query; One additional thing - the form will be for ilustration purposes only, meaning no data will be entered. Just if someone is looking for all this data on a regular basis, it will just show up on that form....in the worst case scenario, I will just make forms for every query..... Thanks for the idea Curtis!.
Rgds.
Atol
 

neileg

AWF VIP
Local time
Today, 07:48
Joined
Dec 4, 2002
Messages
5,975
If you are returning a single figure from your query, you may be better off using a domain aggregate function, Dsum() DMax() etc.
 

atol

Registered User.
Local time
Yesterday, 23:48
Joined
Aug 31, 2007
Messages
64
Thanks Neil. I used "count" since that was what I needed. here is the case actually. I use the same table as an underlying datasouce. I have let's say customers, and they are in two categories (A and B), and also they could be active and inactive. I have separate quieries to do: 1. count all customers, 2. count all "active", and all 'inactive" customers, and 3. count how many customers I have in each of the two categories (A and B); I used Group By and Count in the queries. Now, what I was trying to acomplish was just to get a snapshot on a form for a presentation purposes only...if some of my managers for example wants to see all customers (total), and respectivelly those that are in A and B categories, and also Active and Inactive....I guess this could be done with a Crosstab query...but not sure; never done Crosstabs.... something like this for example:
Total Customers: 999
of which:
category A: 555
Category B: 444

Then,
Total active: ......
Total Inactive........ ( no need to show which of the above categories they belong to)

Does this make sense the way I am explaining?
Thanks!
 

CEH

Curtis
Local time
Today, 01:48
Joined
Oct 22, 2004
Messages
1,187
One question comes to mind.... why show all this in forms? Reports come in very handy.... and look better when printed.
 

neileg

AWF VIP
Local time
Today, 07:48
Joined
Dec 4, 2002
Messages
5,975
atol, I still think that DCount() might be a better solution for you.
 

atol

Registered User.
Local time
Yesterday, 23:48
Joined
Aug 31, 2007
Messages
64
Thanks guys.
Curtis - I guess form is easier to send via e-mail as a screen shot..., Report is not bad idea; I have also thought about that.

Neil - do I use DCount() in a query or as a vba code? never used it before with all honesty...
 

neileg

AWF VIP
Local time
Today, 07:48
Joined
Dec 4, 2002
Messages
5,975
You would use DCount() as the datasource for a control on your form.
 

Users who are viewing this thread

Top Bottom