Display # of records from query on a form

Harley

Registered User.
Local time
Today, 05:43
Joined
Dec 8, 2005
Messages
54
I have a query that querys another query for check boxes that are checked. I would like to display in a text box on a form the # of records that the query found to be checked. I have looked all day and have found nothing that I have enough knowledge to use. I need to know how and how to apply this. If you have other suggestions to do this, I am game! :)
Thanks!!!
 
Is not the record navigation bar display number of records queried/filtered/selected ?
 

Attachments

  • 1.JPG
    1.JPG
    20.2 KB · Views: 138
Yes , the number of records are displayed in the querie, but not on the form. This database is for the company that I work for. Possibly a dozen people input or look at it regularly. They do not look at queries. They look at forms or reports. On the form they input a range of data that they want to information about. I have a queried a query to get the check boxes that were checked (True). I want to show on the form the number of checked boxes.
Thanks
 
can you make a print screen of your form to see how it works ?
 
Form.jpg
aleb said:
can you make a print screen of your form to see how it works ?
This is a cropped copy. I hope this is what you wanted.
 
ok ... your cropped copy didn't explain anything ... I am assuming that you have a form with some fields to filter records and also among filtered records you need to know how many of them are "checked".
create a query with selection criteria referencing to your form fields plus "checkedfieldname"=true.
Put additional field on a form
In control source for this field put:
= dcount("*","yourqueryname") now you need to requery this field every time the selection changes: In every field which is used for selection criteria, "on change" event put: me.yournewfield.requery
 
The query is working. Here it is:
SELECT DISTINCTROW Count([Control Room Query].[Run Number]) AS [CountOfRun Number]
FROM [Control Room Query], RunNumbers
GROUP BY [Control Room Query].DrumRun
HAVING ((([Control Room Query].DrumRun)=True));
I want to put my count result on a form in a text box. The form was already created based on a different query. How do I get the result to show in the text box?
Thanks!!!
 
I put this =DLookUp("Control Room Drumctqry") in Control Source and got ther error in the attachment. There are two fields in the query. Maybe that is the error? If so, how do we put the field in the DLookUp statement? I am not sure that my attachment is attached! The error is: "The expression you entered has a function containing the wrong # of arguments".
 

Attachments

  • Error.jpg
    Error.jpg
    11.6 KB · Views: 140
That got rid of the error but it is not displaying my result. Let me work on it and see if I can find out what I am not doing correctly. Thanks much for your help. Keep an eye out. There is a very good possibility that I will be back! :)
 
OK, I give. If I run the query I see the results of my count but on the form I do not. Any suggestions?
 

Users who are viewing this thread

Back
Top Bottom