Combo Box Question

  • Thread starter Thread starter Bob Vance
  • Start date Start date
B

Bob Vance

I have a combo box that list Clients and ClientsID Number from a query,
What I want to do is after I select a Client i want to show the ClientsID
number in a text box on the same form [tbClientID]
 
Bob,
Try it a bit differently...
For cboClientID... make two columns...
ClientID ClientName
Bind the combo (ControlSource) to your ClientID field.
Set up the combo properties...
Columns = 2
ColumnWidths = 0"; 1.5"

This setup will allow you to select a client by name, show that name in
the combo, but... store the ClientID
in the bound ClientID field. Two birds with one stone... no code needed.
That's usually the preferred method...
---------------
If you really need to do it the way you described, use the AfterUpdate
event of the combo to...
YourFormClientIDField = cboClientID.Column(1)
Combo columns are numbered left to right... 0,1,2,3,4,... etc.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
Al , Absolutly Brilliant I used the after update to send the ID number to
the text box. Thanks You Kindly Bob :)

Al Campagna said:
Bob,
Try it a bit differently...
For cboClientID... make two columns...
ClientID ClientName
Bind the combo (ControlSource) to your ClientID field.
Set up the combo properties...
Columns = 2
ColumnWidths = 0"; 1.5"

This setup will allow you to select a client by name, show that name in
the combo, but... store the ClientID
in the bound ClientID field. Two birds with one stone... no code needed.
That's usually the preferred method...
---------------
If you really need to do it the way you described, use the AfterUpdate
event of the combo to...
YourFormClientIDField = cboClientID.Column(1)
Combo columns are numbered left to right... 0,1,2,3,4,... etc.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."


Bob Vance said:
I have a combo box that list Clients and ClientsID Number from a query,
What I want to do is after I select a Client i want to show the ClientsID
number in a text box on the same form [tbClientID]
 

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

Similar Threads


Back
Top