Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Apr 2008
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Totals Query (2002)

    I have created a totals query to count number of LNFN . Fields teacher and count number of LNFN. Query works fine.
    I would like to take this query and connect it with another table (fields teacher and Location) and use it to create a form. I would not be changing the count number of LNFN field.
    Apparently you can not use a totals query with another query-table and be able to enter data.
    Any suggestions on how to work around this. Converting the totals query to a table was the only idea I could come up with.

    Thanks.

    Paul

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Totals Query (2002)

    A totals query is not updateable, and as soon as you add a totals query to another query, that query becomes not updateable too.

    Use the table (with teacher and location) as data source for the form. You can display the count on this form in a text box that uses DLookup in its control source. The control source could look like this:

    =DLookup("CountOfLNFN", "NameOfTotalsQuery", "Teacher=" & [Teacher])

    where CountOfLNFN is the name of the count field in the totals query, NameOfTotalsQuery is the name of, well, you get it, and Teacher is the name of the field identifying the teacher. I have assumed that it is a number field. If it is a text field, use:

    =DLookup("CountOfLNFN", "NameOfTotalsQuery", "Teacher=" & Chr(34) &[Teacher] & Chr(34))

    Chr(34) is the double quote " character.

  3. #3
    2 Star Lounger
    Join Date
    Apr 2008
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Totals Query (2002)

    Thanks Hans

    It works great!

    Paul

Posting Permissions

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