How to populate the value of a Text Box based on the value in a Combo Box in MS Access 2007?

前端 未结 3 670
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-17 01:59

I have a combo box which is of a lookup type, i.e., I\'ve selected the source to be a column from a table and am storing the selected value in another table. The table which

3条回答
  •  别那么骄傲
    2020-12-17 02:44

    After reading the question and answers I tried the following, and it seems to work well (so far):

    In order to display more than one column of a combobox selection, I have resorted to the following:

    Place a textbox over the combobox, Size it by sampling other fields, so that it covers the text frame of the combobox. I have purposely have left a small space to the right of the NEW textbox to indicate that it Is NOT part of the combobox.

    In the Control Source for the textbox enter the expression below:

    =[DefaultAcct].[Column](1) & "  " & [DefaultAcct].[Column](2)
    

    Then, in the ‘onchange’ event of the combobox, set focus to the textbox.

    Private Sub DefaultAcct_Change()
        txtConcatenate1.SetFocus   
    End Sub
    

提交回复
热议问题