Hello cheaptrinkets,
Thank you for your question.
Unless I am misunderstanding what you wish to do, this can be done
very easily.
Create a text box and assign that data source for the text box as
=GetRecordCount([Form])
This will display the total number of records. If you run a query
against this database that will produce a subset of records, the
number in this text box will change to reflect how many records have
been selected as a result of running the query.
If you really desire to insert the number of records from a query, I
located the following message for you by searching [query result in
text box] :
Tek Tips Forums
http://www.tek-tips.com/gviewthread.cfm/lev2/4/lev3/27/pid/702/qid/404093
Hello. I'm using access 2000.
My problem should be easy to solve but I don't seem to get how.
I have a form with a text box which I want to autofill with a result
that I get from a query.
The query works just fine.
I'm trying to do that with the expression builder, but it doesn't
work, I always get the error "#name?" in the text box.
How should I do it?
Answer:
You can use DLookUp:
=DLookUp("YourField", "YourQuery", "YourCriteria")
Access help shows quite a bit of information for DLookup.
Additionally, searching [DLookup +query], I found:
MSDN
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/off2000/html/acfctDLookup.asp
"You can use the DLookup function to get the value of a particular
field from a specified set of records (a domain). Use the DLookup
function in Visual Basic, a macro, a query expression, or a calculated
control on a form or report..."
There is a wealth of information about DLookup in this article.
I believe my original suggestion should accomplish what you desire (
and I use it successfully in many of my databases), however if you
require using the query to obtain the number of records, the DLookup
function should provide your solution.
I trust my research has answered your question, however if a link
above should fail to work or my research require further explanation,
please do post a Request for Clarification.
Best Regards,
-=clouseau=- |