+ Reply to Thread
Results 1 to 5 of 5

A multi-option box for a search form

  1. #1
    Registered User
    Join Date
    11-02-2010
    Location
    Albuquerque, NM
    MS-Off Ver
    Excel 2007
    Posts
    99

    Question A multi-option box for a search form

    I've created a database to search through all the different types of PTO used. I am using a continuous form where the search functions are on the top, the displayed data in the middle, and a pivot chart on that data below. Currently you can search by Employee Number, Employee name, data range, and one selected type of PTO. However, I would like to select multiple types and have it show up in the search. Here is a look at the code I am using:

    Please Login or Register  to view this content.
    I can get everything to work, however I can only select on type at a time. If I don't select any it displays all types.

    Currently all data is within a master table called total time. And the items for the multi-list box are in a table calle pay code. Those tables are related based on PTO Type

    If you know how to solve this problem, please help

    CharterJP
    Last edited by CharterJP; 11-02-2010 at 02:30 PM.

  2. #2
    Forum Contributor
    Join Date
    04-23-2009
    Location
    IOWA
    MS-Off Ver
    2010 Professional
    Posts
    270

    Re: A multi-option box for a search form

    CharterJP,

    First off welcome to the website.

    You need to edit your first post to be in accordance with the Forum Rules. ie. Wrap your code in Code Tags.

    I have a couple of suggestions and questions.

    What is PTO? (to me it means Power Take Off) (farming community)

    I would suggest not using filters. I would alter the forms recordsource using SQL. It will give you the ability to create as complex of a filter as you could ever dream. And minimize how much data you actually have loaded.

    I would make your complex search box a seperate form, use it and the selections to change the recordsource SQL statement for the main form.

    Hope this helps,

    Dan
    "I am not a rocket scientist, I am a nuclear engineer." - Split_atom18
    If my advice has been helpful to you, then please help me by clicking on the "Star" and adding to my reputation, Thanks!

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: A multi-option box for a search form

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    11-02-2010
    Location
    Albuquerque, NM
    MS-Off Ver
    Excel 2007
    Posts
    99

    Re: A multi-option box for a search form

    PTO stands for Paid Time Off.

    And there are 6 different types employees use for their PTO.

    Now I am not that familiar with the SQL, could you walk me through your thoughts/example/etc.?

  5. #5
    Forum Contributor
    Join Date
    04-23-2009
    Location
    IOWA
    MS-Off Ver
    2010 Professional
    Posts
    270

    Re: A multi-option box for a search form

    CharterJP,

    Here is a simpler example of what (I believe) you are trying to do:

    Please Login or Register  to view this content.
    This part here:

    Please Login or Register  to view this content.

    Looks up a field in a table I have that stores predetermined filters.

    For example:

    If I typed "Dan" in the Field Search on my form (an unbound text box) and I selected Suppliers from my unbound combo box on the form (Me.cboFilters) It would only show me the list of anywhere Dan is located AND ("Supplier = -1" is what is in the filter table) only those contacts who are suppliers.

    Hope this makes sense,

    Dan

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1