Populate a text box from a combo box selection

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!!!
 
D

Dale Fye

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

LADOCITGUY

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.
 

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

Top