Results 1 to 2 of 2
  1. #1
    ajohn is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2013
    Posts
    1

    check box button used with combo box button

    Hello,

    This is my first post and I'm kinda new to access.



    i have a search form that have a few combo boxes that a user will input values and these values are passed to a query that will show the query results on a subform. I have this one combo box which will only contain 3 values and if the user leaves the combo box blank, all records will show up.

    my query parameter looks something like this:

    Like "*" & [Form]![Something] & "*"

    and the combo box contains 3 values, lets just say "A","B", and "C".

    I want to create a check box that if this is unchecked, and the combo box is blank, this will show "A" or "B". If the check box is checked, and the combo box is blank, this will show all records ("A", "B",and "C").

    I can't figure out whether to do this in the form design or query parameters.

  2. #2
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    There are several ways to do what you want.

    One good way, if there is only one combo box involved, is to have the afterupdate event of the combo box set the filters on the form or subform.

    When there are a few different user controls, combo boxes, text boxes, check boxes and so on, I usually create a VBA routine that will build the whole query based on the settings of all the controls, and have each control's afterupdate event call that same routine. That way, I don't have to GUESS about any of the settings.

    There's a sample of that VBA in post #8 of this thread - https://www.accessforums.net/queries...orm-36100.html

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

Similar Threads

  1. Access Check box and Option Button
    By nimesh844 in forum Access
    Replies: 2
    Last Post: 04-26-2013, 08:12 AM
  2. Replies: 1
    Last Post: 08-09-2012, 04:19 PM
  3. Replies: 10
    Last Post: 03-21-2011, 02:46 PM
  4. Form Control Button / Combo Box
    By canuck in forum Forms
    Replies: 1
    Last Post: 03-18-2011, 10:17 AM
  5. Replies: 6
    Last Post: 02-09-2010, 07:53 AM

Tags for this Thread

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