Fill Combobox from Textbox entry

djackson

Registered User.
Local time
Today, 19:29
Joined
Apr 20, 2009
Messages
19
I require more help from your lovely selfs please :)

I have a form that has a combo box and a text box on it.
The combo box looks up a list of customer names from a query, and the after update event automatically fills the text box with the customer number from that query. See below:
Code:
Private Sub CustName_AfterUpdate()
Me!CustNo = Me!CustName.Column(1)
End Sub

I would like user to be able to have the choice of doing it the other way to. So, if they already have the customer number, they can enter it into the text box, press enter, and have it automatically fill the combo box with the name.

Is this possible?

The query that the combo box looks up only contains the 2 columns CustNo and CustName

Many thanks

Dave
 
I use 2 combos, both bound to the number, but one displaying names:

Code:
Private Sub cboAcctName_AfterUpdate()
  Me.cboAcctNum = Me.cboAcctName
End Sub

Private Sub cboAcctNum_AfterUpdate()
  Me.cboAcctName = Me.cboAcctNum
End Sub
 
Thank you very much Paul, that works perfect!
 

Users who are viewing this thread

Back
Top Bottom