Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Jan 2004
    Location
    Pontiac, Michigan, USA
    Posts
    170
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Query Prompt & Parameters (XP-SP1)

    I have a query for a report that I want to add a prompt to specifying which salesman's records are selected. That I can do. However, how do I make it so I can get ALL the various salesmen's records?

    TIA

  2. #2
    2 Star Lounger
    Join Date
    Jan 2004
    Location
    Pontiac, Michigan, USA
    Posts
    170
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query Prompt & Parameters (XP-SP1)

    I found the answer and it was sooo simple. It was in a sample database I downloaded on queries from Microsoft I think.

  3. #3
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Query Prompt & Parameters (XP-SP1)

    For the benefit of others would you post your solution please.

  4. #4
    2 Star Lounger
    Join Date
    Jan 2004
    Location
    Pontiac, Michigan, USA
    Posts
    170
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query Prompt & Parameters (XP-SP1)

    Pat, here it is. I believe that I downloaded the query sample database from MS's KB. It is called QrySampl.mdb.

    Object: Create a report that lists only one salesman's customers or all of the customers.

    In the Query, in the Salesman column in the OR row, I have:
    [Enter Salesman # or <Enter> for all: ]

    Note: I did have a longer statement but it apparently was too long so keep that in mind.

    The In created a new column in the query and copied the above parameter into the FIELD. It comes out looking like this:

    Expr1: [Enter Salesman # or <Enter> for all: ]

    Then in this column's CRITERIA, I entered: Is Null
    In the OR row, I entered: Is Not Null

    That ends the query part.

    Since I wanted the report to show which salesman or if it was ALL salesman, I put the following in a text box in the header in my report:

    =iif([Enter Salesman # or <Enter> for all: ]>0,("For Salesman #: " & (Enter Salesman # or <Enter> for all: ])),"ALL Salesmen")

    I'm sure there are more elegant ways to do this. However, I'm no programmer and just barely about beginner in using Access so this is the simple way and simple explanation.

    Peggy

    P.S. How do I put bold or italics in my posting?

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

    Re: Query Prompt & Parameters (XP-SP1)

    Peggy,

    Thanks for sharing the solution.

    You can format a post by inserting tags from the 1-Click TagPanel, or by typing the tags yourself. For example, to make a word bold, put <!t><!/t> before it and <!t><!/t> after it. For italic, it's similar with <!t><!/t> and <!t><!/t>. For example, <!t><!/t>Woody's<!t><!/t> <!t><!/t>Lounge<!t><!/t> becomes Woody's Lounge. You can find an overview of the available tags in <!help=19>Help 19<!/help>.

  6. #6
    2 Star Lounger
    Join Date
    Jan 2004
    Location
    Pontiac, Michigan, USA
    Posts
    170
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query Prompt & Parameters (XP-SP1)

    Thanks, Hans. I knew the info was there somewhere, just didn't know where.

Posting Permissions

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