Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2010
    Posts
    8

    Unanswered: prompt in query help

    Hi there,

    I have the following prompt in my query:
    [Enter City to visit, New York Or Boston:]
    So the user selects the city they are after.

    Is there a way to adjust this prompt so if the user leaves it blank it will populate the query/report with both cities, i.e Boston and New York?

    thanks

    George

  2. #2
    Join Date
    Apr 2004
    Location
    Derbyshire, UK
    Posts
    789
    Provided Answers: 1
    Quote Originally Posted by GeorgeCC View Post
    Hi there,

    I have the following prompt in my query:
    [Enter City to visit, New York Or Boston:]
    So the user selects the city they are after.

    Is there a way to adjust this prompt so if the user leaves it blank it will populate the query/report with both cities, i.e Boston and New York?

    thanks

    George
    Hi

    You could try something like this
    Code:
    IIf(IsNull([Enter City to visit, New York Or Boston:]),"New York",[Enter City to visit, New York Or Boston:]) Or IIf(IsNull([Enter City to visit, New York Or Boston:]),"Boston",[Enter City to visit, New York Or Boston:])
    It is not clear if there are more that the two Cities available in the DB, if so, then this should do what you indicated.

    If there are more than two, and you want them all retuning if the request is left blank, then use this
    Code:
    Like IIf(IsNull([Enter City to visit, New York Or Boston:]),"*",[Enter City to visit, New York Or Boston:]) Or IIf(IsNull([Enter City to visit, New York Or Boston:]),"*",[Enter City to visit, New York Or Boston:])

    MTB

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    far better to ditch the prompt altogether in my books
    offer the user the choice in say a list box and then write the query on the fly.
    doing it thsi way is prone to problems, ferisntace if some bright spark demands that you should add, say Los Angles.. or whatever. each change requires a change by you in the code, whereas the onus for that change, the management of that change should be on the user.. they merely add the new city to the relevant table and jobsagoodun.

    its called ownership of the system, its 'thier' system let them make the configuration choices and do the day to day system config management
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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