General discussion

  • Creator
    Topic
  • #2344587

    dynamic combobox

    Locked

    by sadbhavana ·

    I use Micorsoft Access 2000. I have a form which contains among others one field(refctrl) and a combobox (refsubj). Depending on whether the field refctrl is blank or filled in the items to be displayed in the combo box refsubj should be dynamicallyregulated. How can this be done? What is the VBA code that will help?

All Comments

  • Author
    Replies
    • #3722078

      dynamic combobox

      by andrew ·

      In reply to dynamic combobox

      Here’s one way:

      Add code to the Text box Change event handler:

      Private Sub Text1_Change()
      If Text1.Text <> “” Then
      Me.Combo1.RowSource = “SELECT Table1.key FROM Table1;”
      End If
      End Sub

      Test the field and set the combo’s RowSource property if not blank.

    • #3614196

      dynamic combobox

      by sadbhavana ·

      In reply to dynamic combobox

      This question was closed by the author

Viewing 1 reply thread