+ Reply to Thread
Results 1 to 4 of 4

Thread: Adding ALL Button to Combo Box

  1. #1
    Barn Newbie Northernlion is an unknown quantity at this point Northernlion's Avatar
    Join Date
    Jul 2008
    Posts
    2
    Rep Power
    4

    Adding ALL Button to Combo Box

    Hey guys I have a problem that's been giving me trouble for a couple days now. I have a search form with several combo boxes and buttons to generate reports. The values of the combo boxes feed into the query criteria then the report generates records based on these criteria.

    All but one of the combo boxes are based on values I type in. The other is based on a table named tblCampaigns that has only one field: CampaignName. What I would like to do is get this combo box to have an ALL option that brings up records based on every campaign name. Here's my current row source:

    SELECT tblCampaigns.CampaignName
    FROM tblCampaigns;

    Thanks in advance!

  2. #2
    Lightning Master AOG123 is a jewel in the rough AOG123 is a jewel in the rough AOG123 is a jewel in the rough AOG123 is a jewel in the rough AOG123's Avatar
    Join Date
    Mar 2008
    Location
    Fortress Of Solitude
    Posts
    394
    Rep Power
    7

    I assume your using a query to provide the filters based on the combo value?

    Lets say your report is based on a query,. using the below in the criteria of the field you are filtering will provide all when the combo is left blank.

    Code:
     Like "*" & [Forms]![FormName]![ComboName] & "*"
    
    Let me know if i'm on the right track
    If i helped you, make me famous by clicking the

  3. #3
    Barn Newbie Northernlion is an unknown quantity at this point Northernlion's Avatar
    Join Date
    Jul 2008
    Posts
    2
    Rep Power
    4

    Thanks man, that works great!

    Just one thing though,

    This works when the value for the combobox is blank. Is there anyway to make the blank value say "ALL" without adding another column? Alternatively, is there any way to make the blank an option? As of right now it's just the default value and then when you click another campaign you can't get back to it.

  4. #4
    Lightning Master AOG123 is a jewel in the rough AOG123 is a jewel in the rough AOG123 is a jewel in the rough AOG123 is a jewel in the rough AOG123's Avatar
    Join Date
    Mar 2008
    Location
    Fortress Of Solitude
    Posts
    394
    Rep Power
    7

    I'm not sure at the moment about adding an "all" to the selection as this would be criteria filtered on.

    But the easiest way to clear the filter would be to add a small command button next to the combo with the following on click event.

    Code:
    Private Sub Command_Click()
    Me.ComboName = Null
    
    End Sub
    
    If i helped you, make me famous by clicking the

+ Reply to Thread

Similar Threads

  1. adding numbers
    By todd2006 in forum JavaScript Programming
    Replies: 2
    Last Post: July 3rd, 2008, 02:38 PM
  2. Combo Box - Add Entry Not In List
    By AOG123 in forum Access Database Samples
    Replies: 0
    Last Post: June 6th, 2008, 10:35 AM
  3. delete button
    By techker in forum Microsoft Access
    Replies: 14
    Last Post: May 21st, 2008, 09:56 AM
  4. Webform Default Button
    By Devwhiz in forum .NET Development
    Replies: 9
    Last Post: May 15th, 2008, 02:15 PM
  5. Dynamic Combo Maker
    By mehere in forum ASP Code Samples
    Replies: 0
    Last Post: March 28th, 2008, 10:40 AM

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

SEO by vBSEO