Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying different query results on one form 2

Status
Not open for further replies.

Moss100

Technical User
Aug 10, 2004
586
GB
Hello.

I need to show the number of records that are past a certain date and display this number on a single form

For instance.

Show the number of properties that have gas checks due
Show the number of properties that have electric checks due
Etc...

I have achieved this by placing sub forms on a form, with each subform based on an appropriate query.

It seems a bit of a messy way to do it and space wise the sub forms eat into the form real estate.

Is there a better approach to take ?

Many thanks mark.
 
Have a look at the DCount function.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
If the form's record source contains all the records and fields needed, you could use a simple text box. The control source depends on your data. If you have an un-normalized table with a yes/no field named [gas checks due], your control source would be:

Code:
=Sum(Abs([gas checks due]))

This might be the most efficient solution but depends on your tables and record sources.

Duane
Hook'D on Access
MS Access MVP
 
Thanks guys - in this instance the DCount was just what I needed.

Many thanks to you both. Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top