Form text box based on combo box

K

kuslusr1

I have a text box on a form where the control source is based on a combo box
selection "=[cboLocation].[Column](2)". The correct data will load on each
page of the form, I would like to know how to apply the data to the
"Location" table field "BelongsTo".
Please advise
 
J

John W. Vinson

I have a text box on a form where the control source is based on a combo box
selection "=[cboLocation].[Column](2)". The correct data will load on each
page of the form, I would like to know how to apply the data to the
"Location" table field "BelongsTo".
Please advise

You're sure you're not storing the field redundantly? What's the Recordsource
for the form, and the Control Source and Row Source for the combo box?

If you're in fact ok with storing this value, you'll need to "push" the data.
Use a textbox (named, say, txtBelongsTo) on the form with a control source of
BelongsTo, and put code in cboLocation's AfterUpdate event:

Private Sub cboLocation_AfterUpdate()
Me!txtBelongsTo = Me!cboLocation.Column(2)
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top