Select item from combobox that displays rest of info automatically

  • Thread starter Thread starter dosima
  • Start date Start date
D

dosima

Hi

I have a main form where i want the user to select a court name from a combo
box and once they do it automatically displays the address underneath.

i've created a seperate form and table which displays all the court names,
addresses and telephone numbers.

i've worked out how to create the combo box that list all the court names,
but am not sure how to make the address and telephone display as soon as it
has been selected.

Thanks in advance
 
Use the After_Update event of the combobox. Does the combobox only show the
court name, or does it also have columns with the address information?

Ken
 
Hi

I have a main form where i want the user to select a court name from a combo
box and once they do it automatically displays the address underneath.

i've created a seperate form and table which displays all the court names,
addresses and telephone numbers.

i've worked out how to create the combo box that list all the court names,
but am not sure how to make the address and telephone display as soon as it
has been selected.

Thanks in advance

Include the fields that you want to see in the combo box's RowSource query; be
sure that the combo's ColumnCount property is large enough to include all the
fields. You can use the combo's ColumnWidths property to set the width of the
fields to 0 - for instance if the combo's rowsource is

SELECT CourtID, CourtName, Address, City, Postcode, Phone
FROM Courts
ORDER BY Courtname;

you could use a ColumnCount of 6 and a ColumnWidths of

0";1.25";0";0";0";0"

to have the combo show only the court name.

Then on the form put textboxes with Control Sources like

=comboboxname.Column(n)

where n is the zero based index of the field you want to see. The Address
textbox would use (2) to get the third column in the query.
 
the combobox only shows the court name.
But the court table has a court name, court address and court number.

i have a main form where the court name is bound to, so when the user select
a court name it will automatically display the address in a text box
underneath.

how do i go about using Afterupdate. i'm not sure what code to put in, and
also if i need to put code in the combo box and textfield
 

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