problem refering to field on tab form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BankGirl
    New Member
    • Jan 2008
    • 5

    problem refering to field on tab form

    Hi

    I have a form with a control tab of 3 tabs. i have a drop down box and i want to add a text box next to it that brings up the second value in the combo box. so when they select something, field next to it will show up with the firstname.

    thanks
  • sierra7
    Recognized Expert Contributor
    • Sep 2007
    • 446

    #2
    Hi
    There are two way of doing this. It sounds as though you combo box is already showing a second column, so the easiest way is to set the Control Source of your TextBox

    =[ComboBoxName].[Column](1)

    The other way would involve modifying the query for the form by joining the table used as the basis for the combo box, then ensuring that the name of the field to be shown in the text box was included in the select query. The text box then becomes just another bound control.

    Hope this helps

    S7

    Comment

    • jaxjagfan
      Recognized Expert Contributor
      • Dec 2007
      • 254

      #3
      Sierra7 is right. The easiest way is to refer to the second column of the combobox which is column(1). Make sure the Name value is in the 2nd column of the combo tho.

      If it is not possible to include the Name in the combo then you can use a Dlookup function in the textbox - something like this:

      =DLookup("[YourRtnFieldNam e]", "YourTableName" , "[YourLookupField] ='" & Me.YourComboBox Name & "'")

      Comment

      Working...