ComboBox to Dislplay only Certain Values

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

Guest

I want a ComboBox1 to display values (Client Name) based on a Client ID
(entered manually by a user) in another ComboBox2. Does ComboBox2 need to be
set up based on a query? How can I accomplish it?
 
Monia,
One combo box will do the trick.
1. Create a combobox, (you could call it cboSelectClientID) and place
ClientID in column 1 and the ClientName in column 2.
2. Set the combo's Column Count to 2
3. Set the combo's Bound Column to 1
4. Set the combo's Column Widths to 0";1"
5. If this combo needs to be bound to a field, bind it to your ClientID
field.
Now... the combo appears to display only client names for the user to
select, and after selection "displays" that name. But, what's really
stored in the field is the ClientID. So, this arrangement does takes full
advantage of combobox functinality, and does "double duty."
 
I want users to enter client ID and Client name to appear automatically
(display purposes only). Otherwise my users will have to search through over
5000 items to choose the right client name.
 
Monia,
Well, I'm not sure what the difference between selecting 1 of 5000 names
and 1 of 5000 IDs is but...

No need for a combo to display the ClientName, a calculated text control
will do it.
Create a combo (ex. cboClientID) with ID in the first column, and
ClientName in the second column. Use a query with those two fields as the
RowSource for the that combo. As the user types an ID, the combo will
attempt to find that ID from it's list.

Add an unbound text control (ex. txtClientName) to the form with a
ControlSource of...
=cboClientID.Column(1)
Whenever the user selects a Client ID, the calculated control will
display the associated ClientName. (Combo box columns are numbered 0,1, 2,
etc...)
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions
 
Al,

I'm having trouble witih syntax for the control source for txtClient Name. I
tried Client ID.Column(1) but the text box displays #Name? error.

Client ID is the name of the combo box with client ID and client name.
 

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

Back
Top