Results 1 to 11 of 11
  1. #1
    bpownall is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2011
    Posts
    5

    Displaying records for one ID from query in form

    Hello,
    I am new to access and was hoping for some help as I have been stuck. I am creating an inventory database where of equipment and I created a query to determine how many tanks of certain sizes and types exist on a given location. I also have a query that pulls my suggested types and sizes. I want these queries to be shown on a form where a user can select a well name from a combo box, etc and the queries then show the results for this name. I cannot for the life of me figure out how to make a query display only one result on the form from this. Any help would be greatly appreciated.

  2. #2
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows 7 64bit Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    In 2003 you can use Totals in a Query.

    2010 must have something similar but I can't help a lot. I would think if you search TOTALS in Access help you should find something. Or perhaps there is something in the Northwind DB.

  3. #3
    bpownall is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2011
    Posts
    5

    Re

    sorry I do not want to just display the total amount of tanks. What I am wanting is on a given form to select a wellname, then have the queries as subforms below show the results for that well name.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Why don't you show us the query sql? Explain what you want to happen; tell us what isn't working specifically; and perhaps someone will have an answer/suggestion.

    It's hard to offer advice when we are having to guess at what you have tried, what you really want and how you are doing testing.

  5. #5
    bpownall is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2011
    Posts
    5

    Sql

    Pretty simple crosstab query. I get the name of the lease, have different rows for water, oil, and the separator tank, then in the columns count the different number for each type of volume tank since each tank has a different serial number. I would like to show the results for one lease name on a form. I have tried a parameter query but it just ran query in background instead of on form. Below is the sql for the tank query.

    TRANSFORM Count(Tanks.Serial) AS CountOfSerial
    SELECT Tanks.LeaseName, Tanks.TankContents
    FROM Tanks
    GROUP BY Tanks.LeaseName, Tanks.TankContents
    PIVOT Tanks.Volume;

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    I created a table and some sample data. With your query I get the attached output.

  7. #7
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows 7 64bit Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    Quote Originally Posted by bpownall View Post
    sorry I do not want to just display the total amount of tanks. What I am wanting is on a given form to select a wellname, then have the queries as subforms below show the results for that well name.
    `
    What was wrong with the Totals query?

    What didn't it show?

  8. #8
    bpownall is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2011
    Posts
    5

    Replies

    Orange: I get a similar output but I would want that query to show just john smith breweries results in a form. Maybe a combo-box in a form with those 2 names and the query underneath as a subform wouuld show results for which name is selected.

    Rainlover: Please read above. Would a totals query do this?

  9. #9
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Why are you using CrossTab?
    Can you mock up a jpg of what you'd like to see?

    The output I showed previously doesn't really tell me much, but it's your query not mine.

  10. #10
    bpownall is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2011
    Posts
    5

    picture

    See attached picture. If I could make this work I could also have another query of suggested volumes for the tanks below. A button could be included to run the query on the form if that is what would make it work.

  11. #11
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Ok what are the tables and fields involved? There was nothing in earlier material re oil, water, separator...

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Displaying multiple records on one form
    By Juicejam in forum Forms
    Replies: 12
    Last Post: 12-12-2011, 07:02 PM
  2. Replies: 3
    Last Post: 03-25-2010, 12:31 PM
  3. Displaying records from a form
    By ceb39 in forum Access
    Replies: 5
    Last Post: 04-03-2009, 12:36 PM
  4. Displaying Query Properties in a Form
    By Bjar in forum Programming
    Replies: 1
    Last Post: 07-16-2008, 07:51 AM
  5. Form field not displaying in query
    By Valeda in forum Queries
    Replies: 2
    Last Post: 05-05-2006, 10:08 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums