Results 1 to 5 of 5
  1. #1
    Join Date
    May 2004
    Location
    UK
    Posts
    8

    Unanswered: Combo Box Row Source Filter

    Hello All,

    I am attempting to set the row source of a combo box on a form to one of two tables dependent upon the contents of a text box on the same form. The text box contents will be a simple text string, either TM or TS (an equipment model) whilst the two tables contain the corresponding card information for the two equipments.

    I am struggling with what to put in the combo box row source in order to select the relevant table although I am sure I need to add an Event Procedure in the After Update event for the text box.

    Any suggestions?

    Graham
    Last edited by grahamd; 03-08-06 at 08:59.

  2. #2
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634
    Leave the rowsource of the combobox empty and set it in the event from the text box. After Update might be to late, you may want to put it in the On Change event.

  3. #3
    Join Date
    May 2004
    Location
    UK
    Posts
    8
    Any suggestions as to what to put in the Event. What little I know is pointing me in the direction of an If Else statement but I'm not sure how to point to a string. As you can probably tell this isn't something I do every day so please feel free to use words of one syllable or less!

    Graham

  4. #4
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634
    select case me.textboxName
    case "TM"
    me.comboboxName.rowsource = " SQL Statement "
    case "TS"
    me.comboboxName.rowsource = " SQL Statement "
    case else
    msgbox telling user to enter something in the TS/TM field
    end select

    look up Select Case in help

  5. #5
    Join Date
    May 2004
    Location
    UK
    Posts
    8

    Smile Thanks

    Rogue,

    Many Thanks, works a treat!

    Kind Regards

    Graham

Posting Permissions

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