Combo/Text Boxes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table with two fields [Type of Trade] and the other field [GL] which
is tied to [Type of Trade]. My combo box row source is [Type of Trade] I
would like my text box to do the following:

If you select a item from the combo box the [GL] that is tied to [Type of
Trade] fills into the text box unless "other" is selected in [Type of Trade]
then you can manually fill in a GL number.

How would I code this?
 
This can't be done in a table, it would need to be on a form. In the
AfterUpdate event of the combo box, you would assign the value to the
textbox. The Value of the combo box comes from the Bound Column, but you can
specify which column you want to get information from.

Example:
If Me.cboMyCombo.Column(1) <> "Other" Then
Me.txtMyTextbox = Me.cboMyCombo
End If

This assumes that the GL value is in the Bound Column. If not, you'll need
to specify the column desired in the second line also. The index number of
the Column property is zero based, so 0 is the first column, 1 is the
second, etc.
 
Back
Top