Pull Down Selection

G

Guest

I have two fields:

Company ID
Company Name

In the company name field I have a pull down and the pull down shows the
user the "company id" and the "company name". However, when the user makes
their selection it only populates the company name.

I would like it when the user makes their selection that it populates the
company ID field as well and not just company name.

This possible?

Thanks !

Ty
 
L

Lonnie

Private Sub ComboCompany ID_AfterUpdate()

Dim ctlComboBox As Control
You may have to change the name a little but this has
always worked. Here is a sample of how I use it;

Private Sub ComboELastName_AfterUpdate()(Combo Label Name)
I have also found out it is better to use run together
names.

Dim ctlComboBox As Control

Set ctlComboBox = ComboELastName
Me!EFirstName = ctlComboBox.Column(1)
Me!Dept = ctlComboBox.Column(2)
Me!PhoneExt = ctlComboBox.Column(3)

End Sub
Set ctlComboBox = ComboCompany ID
Me!Company Name = ctlComboBox.Column(1)


End Sub
 
L

Lonnie

Private Sub ComboCompany ID_AfterUpdate()

Dim ctlComboBox As Control

Set ctlComboBox = ComboCompany ID
Me!Company Name = ctlComboBox.Column(1)


End Sub

Sorry for the mess up.
 

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