combo box

  • Thread starter Thread starter ted medin
  • Start date Start date
T

ted medin

Built a combo box using the wizard & have the records to select. Now how do
I get the other fields from the record selected to display on the form? TIA
 
Ted,

It is possible to have the drop-down list of items in a combobox to
dispay more than one field from the combobox's Row Source table/query.
But once you make a selection, only one field is displayed. And if the
combobox is bound to a field in the table/query that the from is based
on, the data from the combobox's bound column is entered into the
current record of the form.

So, what else are you trying to do? Maybe you could post back with some
more details and a specific example?

In the meantime, this article may be of interest to you...
http://accesstips.datamanagementsolutions.biz/lookup.htm
 
In the northwind example, I was looking @ the orders. When they found the
company that placed the order, pertinent facts about that company were also
displayed. ie the address, city ... .
 
Did you read the article I mentioned? The Orders procedure in Northwind
are similar to the 'Query' approach mentioned in the article. You can
see that the Orders form has as its Record Source the [Orders Qry]
query. In Northwind, there is the added functionality as well of the
shipping address (Orders table) being populated by default as the
customer's address (Customers table), via the cide that you can see on
the After Update event of the CustomerID combobox.
 
Yes I read the article but I guess you will have to color me dense. To start
with I have 2 tables with group names & their address ... & contacts names
with their address ... . What I am trying to do is have a combo box with the
group names & text boxes with the address ... . When I click on the combo
box I get the list of the names but unable to figure our how to have that
groups address ... displayed in the text boxes. Color me dense :-(. TIA

Steve Schapel said:
Did you read the article I mentioned? The Orders procedure in Northwind
are similar to the 'Query' approach mentioned in the article. You can see
that the Orders form has as its Record Source the [Orders Qry] query. In
Northwind, there is the added functionality as well of the shipping
address (Orders table) being populated by default as the customer's
address (Customers table), via the cide that you can see on the After
Update event of the CustomerID combobox.

--
Steve Schapel, Microsoft Access MVP
In the northwind example, I was looking @ the orders. When they found the
company that placed the order, pertinent facts about that company were
also displayed. ie the address, city ... .
 
Ted,

Probably the easiest method to explain is the 3rd one on my article,
under the heading of 'Column property'.

Make your combobox, and set its Row Source to the table that has the
group names and addresses.
Assuming the names and addresses are the first two fields in that table,
set the combobox's Column Count property to 2.
Then, put your textbox on the form, and set its Control Source property
to the equivalent of...
=[NameOfYourCombobox].[Column](1)

Ok, so now, when you select an item in the combobox, it should show the
group name, and the textbox should show the corresponding address.
 
Ok thanks that will work. However I am wondering how northwind.mdb order
form, bill too gets the address ... in the below text boxes. TIA
 
Ted,

As I mentioned before, look at the code on the After Update event of the
CustomerID combobox.
 
Yes I see how the shipping address ... gets set, but in the address just
below the customer id combo box. Notice that text box, the control source
has 'address' & a bunch of other options under the down arrow. Sorry to be
such a bother.
 
Ted,

No bother. As I mentioned before, look at the [Orders Qry] query. This
is the Record Source of the Orders form, and includes fields from both
the Orders table and the Customers table, including the CompanyName and
Address fields from the Customers table. As I mentioned before, this is
similar to the 'Query' approach mentioned in the article at
http://accesstips.datamanagementsolutions.biz/lookup.htm
 
A couple of further questions.
1. what does the me!... mean in the code
2. how does one create a bounded text box
TIA
 
Ted,

ted said:
1. what does the me!... mean in the code

Me! or Me. in code like that means you are referring to a control or a
property of the current object, i.e. the database object from which the
code is being called, in this case the Orders form. So, for example,
Me!Address means the Address control on the Orders form.
2. how does one create a bounded text box

An unbound textbox means the value of the textbox is not linked to a
field in the form's underlying tableor query, whereas a bound textbox
means that it is. This is determined by the setting of the Control
Source property of the textbox. If the property is blank, or if it
contains a calculation expression or function expression, the textbox is
unbound. If the property is set to the name of a field, the textbox is
bound to that field.
 
Back
Top