Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2013

    Unhappy 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.

    The Background:
    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...

    The Problem:
    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.

  2. #2
    Join Date
    Jun 2005
    Richmond, Virginia USA
    Provided Answers: 19
    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 that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts