Results 1 to 3 of 3
  1. #1
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    All or the parameter amount! (Access XP)

    Hi all,

    I am using a simple parameter to extract order amounts from a field. I have a parameter >=[Enter lowest value to view:]. If a person types 50, it shows order amounts of 50 and more!
    Question:
    How can I set up the parameter to show ALL if a person does not enter a value, or if they do, only the value they enter or higher!
    I found a <post#=403516>post 403516</post#> of Francois, that answers the question, but it only works with text fields.
    He set up the parameter to be: Like "*" & [Enter a Dept Or Leave Blank to Display All], but it fails if I use a > symbol before the [ in the expression.
    Regards,
    Rudi

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

    Re: All or the parameter amount! (Access XP)

    Set up the condition the other way round. In a blank column in the query design grid, type

    [Enter lowest value to view]

    in the Field row. In the Criteria row, enter

    <=[Amount] Or Is Null

    where Amount is the name of the field on which you want to filter. You must remove the original condition for this field, of course.

  3. #3
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: All or the parameter amount! (Access XP)

    Hans,
    I was going to ask you to explain yourself, as I would never have concieved this by myself; it seems to be illogical!!!
    However, when I viewed the SQL, it makes easy reading.
    <pre>SELECT Orders.CustomerID, Orders.OrderDate, Orders.ShipName, Orders.ShipCity, Orders.Freight
    FROM Orders
    WHERE ((([Enter lowest value to view])<=[Freight] Or ([Enter lowest value to view]) Is Null))
    ORDER BY Orders.Freight DESC;</pre>

    Thanx...this one is being filed into my Need to Know directory immediately!
    Regards,
    Rudi

Posting Permissions

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