Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2003

    Unanswered: This time it's combo box trouble......

    Hi all,

    Hope someone can help....

    I have a form containing 8 fields:

    1. Combo1 - (Dropdown of selectable 'Global Names')
    2. shareholding value
    3. shareholding date
    4. Setup ID
    5. Status
    6. Amend ID
    7. Source
    8. Domicile_Region - combo box(2)

    All 8 fields are bound to a 'Shareholdings' table.

    When the user selects a 'Global Name' from combo1, I need to limit the choice of 'Domicile_Region' values they can select from combo2.
    Each 'Global Name' is associated with only 1 possible 'Domicile_Region', and I want to reflect this on the form.
    The 'Global Names' are assigned their specific 'Domicile_Region' in a main table - 'Global Names'.
    (Relevant fields in table 'Global Names' are 'Name'(key), & 'Domicile_Region')

    I've searched around in here and there are a few examples of code that should be able to achieve this, but I can't seem to get it to work using any of them.

    In the properties for combo1, I've put in this afterupdate event:

    Private Sub Combo1_AfterUpdate()

    Me.Domicile_Region.RowSource = "SELECT Domicile_Region FROM Global Names WHERE Name = '" & Me.combo1 & "'"

    End Sub

    When I go to the form, and make a selection from the Global Names dropdown (combo1), and then expand the 'domicile_region' dropdown (combo2), it's blank.

    1. Is the syntax in the code ok?
    2. If I'm setting the rowsource for combo2 in the update event of combo1, do I have to set the rowsource in the actual properties list for combo2 also?

    Sorry if this is difficult to follow, I know my naming conventions are terrible....

    Any ideas? This is driving me nuts.


  2. #2
    Join Date
    Nov 2003


    Working now - left a set of brackets out of the code.



Posting Permissions

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