Combo Box Query Help

  • Thread starter Scott_66701 via AccessMonster.com
  • Start date
S

Scott_66701 via AccessMonster.com

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.
 
T

Tom van Stiphout

On Sat, 29 May 2010 23:00:34 GMT, "Scott_66701 via AccessMonster.com"

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
 
Top