Results 1 to 8 of 8
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Cornwall, England
    Posts
    393
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Query Parameters (Access97)

    I have a report that needs to run with a query parameter referring to a yes/no field. how can i build the query and/or report to accept an english answer to a parameter prompt rather than typing in -1 or 0 to match the appropriate records ?

    I want to prompt the use with something like "Do you want staff with three legs?" so need to have a criteria like [Do you want staff with three legs] but the query just doesnt run. It does work however if i type =No in the criteria of the query in design view ?!?!

    any suggestions warmly received...

  2. #2
    3 Star Lounger
    Join Date
    Jun 2001
    Location
    Maidstone, Kent, England
    Posts
    398
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query Parameters (Access97)

    You could build another column in the query using if to turn your answer to text and filter against that.

    Expr1: IIf([My Yes/No Field]=0,"no","yes")

    HTH

    Peter

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Cornwall, England
    Posts
    393
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query Parameters (Access97)

    i think that is the issue, but i need the opposite affect.
    the yes/no response to the prompt is a string value.when typing in the criteria cell the yes or no does not get changed to "yes" or "no" so i think the field needs a criteria that is a literal yes/no or -1/0. it appears that a prompt cant return a non string value ..?

  4. #4
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Cornwall, England
    Posts
    393
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query Parameters (Access97)

    what a dummy! <img src=/S/stupidme.gif border=0 alt=stupidme width=30 height=30> i have re- read your response, it is ideal,
    thanks a lot <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  5. #5
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Query Parameters (Access97)

    Hi,
    If you define the parameter in your query as being a Yes/No datatype, you will be able to simply type in yes or no at the prompt.
    FWIW.
    Regards,
    Rory

    Microsoft MVP - Excel

  6. #6
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Cornwall, England
    Posts
    393
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query Parameters (Access97)

    how do you define the properties of a parameter then ?

  7. #7
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Query Parameters (Access97)

    Right-click on a blank bit of the main query window (as you would if you were changing the query type) and there should be a Parameters... option (or choose Query-Parameters... from the main menu in query design view). This allows you to specify a name and type for each parameter.
    HTH.
    Regards,
    Rory

    Microsoft MVP - Excel

  8. #8
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Cornwall, England
    Posts
    393
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query Parameters (Access97)

    so simple!
    thanks very much

Posting Permissions

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