Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2004

    Question Unanswered: Combo box recordsource help

    I have a combo box that has its recordsource changed by an option group as follows:

    Opt1 disables the combobox.
    Opt2 enables the combobox and sets its recordsource to a query.
    Opt3 enables the combobox and sets its recordsource to a value list.

    The default value for the option group is Opt1, so the combobox always starts life as disable.

    When the form is opened, I select Opt2 and the combobox values are pulled from a table by the query, and then I select Opt3 and the combobox values are pulled from the value list.

    So far so good, but here is where it gets odd.

    If I now select Opt2 again, the combobox contains only 1 row and the data is the actual syntax of the query used to pull the data.

    Basiclly, first time thru, the combobox has 10 records, the second time thru it only has one record and that record is "SELECT * FROM..."

    Below is the Case statement from the option group:

    Select Case OptGrp
    Case Is = 1 ' View All
    Me.ViewCrit.Enabled = False
    Me.ViewCrit.Value = " "

    Case Is = 2 ' View by Category
    Me.ViewCrit.Value = " "
    Me.ViewCrit.Enabled = True
    Me.ViewCrit.RowSource = "SELECT * FROM tbl_Category;"

    Case Is = 3 ' View by Inventory Status
    Me.ViewCrit.Enabled = True
    Me.ViewCrit.RowSourceType = "Value List"
    Me.ViewCrit.RowSource = "Sold;Listed;Not Listed;In Inventory"

    End Select

    Any suggestions would be great as my head is really hurting trying to figure this one out!


  2. #2
    Join Date
    Sep 2003
    This is rather obvious ... Look at what IS NOT being set ... If you merely specify the RowSource to be "Table/Query" for option 2 thewn problem is solved.

    What's happening is that when you switch to a Value List and then select option 2 you're not switching the combobox BACK to Table/Query hence the result you see ...
    Back to Access ... ADO is not the way to go for speed ...

Posting Permissions

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