Results 1 to 4 of 4
  1. #1
    tatihulot is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    100

    Can a Parameter Query with Several Input Dialog Boxes Have One (Or More) That are Optional?

    Hello, I have a question about creating parameter queries.



    Is it possible to create a parameter query with several separate inputs, but not ALL of the inputs are mandatory?

    For example, my movie collection database has fields for Director, Silent, and Foreign.

    The Foreign field is a Yes/No checkbox. So is the Silent field.

    I want to create a parameter query where you are asked for each value, separately. In other words, three separate dialog boxes.

    Is it possible for one or two of those dialog boxes to be optional? For example, is it possible to skip the third parameter query’s dialog box, which says, “Type Yes for Foreign movies.”?

    Or, can the Director dialog box be optional, so I can just query all of the foreign movies that are also silent?

    I haven’t tried doing this yet. I figured I’d ask about it before doing it, so that I know the proper procedure before undertaking it. Thank you.

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    Do not do it

    Create a form for all the parameters.
    Then you can decide what is mandatory and what is not.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Something must be input. Do you want AND or OR operators? Example:

    SELECT Holidays.HolID, Holidays.HolName, Holidays.Qty
    FROM Holidays
    WHERE (((Holidays.HolName)=Nz([Enter hol],"NewYears")) AND ((Holidays.Qty)=Nz([Enter qty],1)));


    Again, don't do it (I NEVER have). Input boxes would just be a source of frustration for user. Cannot validate input.

    Review http://allenbrowne.com/ser-62.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    tatihulot is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    100
    Thank you. I didn't think it would be the best way to do things, but I wanted to ask. Since I'll be the only person using the database, it would probably be easier for me to write specific queries.

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

Similar Threads

  1. Replies: 6
    Last Post: 08-13-2021, 01:37 PM
  2. Replies: 5
    Last Post: 03-21-2018, 01:07 PM
  3. Input Mask Optional Separators?
    By neo651 in forum Forms
    Replies: 1
    Last Post: 11-27-2017, 07:09 PM
  4. Requerying on close of dialog form - optional?
    By Historypaul in forum Forms
    Replies: 2
    Last Post: 01-07-2015, 04:02 PM
  5. Replies: 4
    Last Post: 09-09-2013, 05:34 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