Populate a text box from a combo box selection

  • Thread starter Thread starter LADOCITGUY
  • Start date Start date
L

LADOCITGUY

I have a form with a combo box called RELEASEDTO on it. The values come from
TBLWORKRELEASEFACILITIES. This table has only 2 fields - WORK RELEASE
FACILITY and PHONE NUMBER.

I need the user to select a WORK RELEASE FACILITY (from my RELEASEDTO combo
box) and have the corresponding PHONE NUMBER populate automatically into the
text box called RELEASEDTOCONTACTINFO on my form.

Please use my fieldnames, etc as they appear if possible in your response.
I'm not much of a programmer and just trying to help out on this database.

Thanks!!!
 
In the afterupdate of your combobox, enter the following:

Private Sub ReleasedTo_AfterUpdate

me.ReleasedToContactInfo = me.ReleasedTo.Column(1)

end sub

You will alsso need to put something like the following in the Current event
of the form, so that the phone number will get filled in if you move about
among old records.

Private Sub Form_Current

if not me.newRecord then
me.ReleasedToContactInfo = me.ReleasedTo.Column(1)
endif

end sub

--
HTH
Dale

email address is invalid
Please reply to newsgroup only.
 
Works great!

Thanks Dale

Dale Fye said:
In the afterupdate of your combobox, enter the following:

Private Sub ReleasedTo_AfterUpdate

me.ReleasedToContactInfo = me.ReleasedTo.Column(1)

end sub

You will alsso need to put something like the following in the Current event
of the form, so that the phone number will get filled in if you move about
among old records.

Private Sub Form_Current

if not me.newRecord then
me.ReleasedToContactInfo = me.ReleasedTo.Column(1)
endif

end sub

--
HTH
Dale

email address is invalid
Please reply to newsgroup only.
 
Back
Top