Results 1 to 2 of 2
  1. #1
    MacLane is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2013
    Posts
    1

    Add an [show all items] option to a Combobox populated by an query

    I created a combobox that lists the top 15 most used possibilities for that field and added a [show all options] to the end of the list. Selecting the [show all items] causes the RowSource of the combobox to be changed to a query containing all options. I want to cancel the Update and dropdown the list but because the [show all items] option is not in the new list Access gives and error message.



    Code:
    Private Sub lstOptions_BeforeUpdate(Cancel As Integer)
    
    If lstOptions = 9999 Then
    Cancel = True
    lstOptions.RowSource = "qryAllOptions"
    lstOptions.Dropdown
    End If
    End Sub
    Does anybody know an alternative method to add an [show all items] option to a Combobox populated by an query?

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    I use toggle controls to toggle between two SQL strings. Another approach would be an option group of radio buttons.

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

Similar Threads

  1. Replies: 11
    Last Post: 11-25-2013, 01:46 PM
  2. Combobox selecting one available option
    By dylcon in forum Forms
    Replies: 4
    Last Post: 06-18-2013, 01:28 PM
  3. Replies: 9
    Last Post: 01-17-2013, 09:08 PM
  4. Replies: 5
    Last Post: 07-29-2011, 03:07 PM
  5. Simple query to show when items are not checked?
    By mrwistles in forum Queries
    Replies: 28
    Last Post: 09-02-2010, 02:52 PM

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