From: Scott_66701 via AccessMonster.com on
I have a combo box with hospital names in it. I am wanting to select a
hospital from the combo box and have the the address text box automatically
fill in with the hospitals address. How can I go about doing this. Please
help.

--
Message posted via http://www.accessmonster.com

From: Tom van Stiphout on
On Sat, 29 May 2010 23:00:34 GMT, "Scott_66701 via AccessMonster.com"
<u54193(a)uwe> wrote:

One way is to have an extra hidden column in the combobox. For example
the rowsource would be a query like this:
select HospitalID, HospitalName, Address & " " & City & " " & State &
" " & Zip as FullAddress
from tblHospitals
(note how I concatenate the various address fields into one column)
Design your dropdown and set the ColumnWidths to "0;1;0" so only the
HospitalName is showing.
Then in your Address textbox set the ControlSource to automatically
pick up the address column:
=myDropdown.Column(2)
(of course you change myObjectNames to yours)

-Tom.
Microsoft Access MVP


>I have a combo box with hospital names in it. I am wanting to select a
>hospital from the combo box and have the the address text box automatically
>fill in with the hospitals address. How can I go about doing this. Please
>help.