Multiple query results on the same Form

kostaskir

Registered User.
Local time
Today, 22:34
Joined
Jan 21, 2009
Messages
65
Hello everybody,

All is about a Music Database with CD Titles and Artists.

I have one table with the name CDTitles. From this particular Table I produce several queries. Like, “Total CD Titles”, “Total money paid”, “Total Tracks”, etc.

I intent to create a big number of queries and to display them in one Form only, called “Statistics”.

As I know in an Access Form on the Properties window you have to declare the source. But, you can declare only one source. And this is my problem. I don’t have only one source but many. The queries are my sources.

Also, I don’t want to use subforms. Just plenty of Edit Boxes or Labels.

I guess through VBA it could be more practical to solve this problem, BUT I don’t know how.

Any ideas? :confused:

Thank you !

P.S.: I use Access 2007.
 
You need to make the form unbound (no record source) and lets say you have a text box called TxtCDCount

Got to the properties of the textbox and in the control source enter

=DCount("*","TblCDs")

like wise you can do the same for total cost but use the DSum() function

What you are actually doing is applying a control source to each textbox

David
 
Thanx a lot,

That was something I didn’t know. And it seems less complex than writing VBA.
So for every edit box I have to write a different expression using these built in functions.
Now I would like to ask you something else but relative with my previous question…

In which case you would write VBA instead of writing expressions ?

Thanks again !
 
In which case you would write VBA instead of writing expressions ?

When a question can have more than 1 answer. DCount, Dlookup etc, will only give you the first "match" it finds. If you want to count how many "rock" CD's AND "Jazz" CD's in one go you have to use a query og some VBA recordset to get your answer.:)
 
I tried the solution with the functions (DCount, Dsum) and it worked perfectly.

Thank you. :D
 

Users who are viewing this thread

Back
Top Bottom