03-20-13, 20:16 #1Registered User
- Join Date
- Mar 2013
Unanswered: Query results in Form where Query relies on same form.
Hello everyone! I'm very new to MSAccess, and I'm struggling here...
I have an Access DB that has several tables; the two that I'm dealing with are ClientT and HouseholdT.
Every ClientT record has a ClientHouseholdID field (along with lots of other client-related data). I have a functional relationship between
[ClientT]![ClientHouseholdID] and [HouseholdT]![HouseholdID]; the latter of which is a Primary Key and an Autonumber. It is a One-to-Many relationship, so one HouseholdID can have many ClientID. That part is all functional...
HouseholdID (PriKey/Autonumber) from [HouseholdT] is echoed on a form ([UpdateHouseholdF]). I've built a query that will count the number of Clients in each household...but it prompts for a HouseholdID. I would like the "Residents:" control on [UpdateHouseholdF] to display the result of the query...but I want it to use the "HouseholdID" control from [HouseholdUpdateF].
Am I making any sense? I can change my methodology a bit, if it will make it work.
03-20-13, 21:52 #2Moderator
Provided Answers: 19
- Join Date
- Jun 2005
- Richmond, Virginia USA
To be honest I got kind of lost in your explanation, but you cannot display the results of a Query in a Textbox on a Form. To display something in a Textbox on a Form that comes from another Table/Query, or to do totals (which sounds like what you're doing, here) from a Table you can set the Control Source of the Textbox to an expression using the DLookup() or DCount() Functions, probably the latter, in this case. Go to Help for the poop on DCount, and holler back here if you have problems with it.
Linq ;0)>Hope this helps!
The problem with making anything foolproof...is that fools are so darn ingenious!
All posts/responses based on Access 2003/2007