Look up boxes


L

LG

If I have a form built with agency, address, city, state, zip all in
different fields.
What I would like to do is if the processor types an agency it will provide
a list from a seperate table and auto populate the remaining fields.
EX.
Sesame Place is the agency the drop down box is provided with 1234 bigbird,
lancaster, pa, 19011 and once clicked it would auto populate the correct
fields in the form.
Is this possible?
 
Ad

Advertisements

S

SuzyQ

yes
Assuming your combo box has fields [agency], [address], [city], [zip],
[keyfield] in the after update event for the combo box put the following code

me.[addressTextBox] = me.[comboBox].column(1)
me.[cityTextBox] = me.[comboBox].column(2)
etc.

if you keyfield in the query for you combo box is in the fist position then
adjust the column numbers accordingly. column numbers start with 0
 
S

SuzyQ

hopefully your addressTextBox and cityTextBox are unbound controls used for
display purposes, because you don't need to store that can query.

SuzyQ said:
yes
Assuming your combo box has fields [agency], [address], [city], [zip],
[keyfield] in the after update event for the combo box put the following code

me.[addressTextBox] = me.[comboBox].column(1)
me.[cityTextBox] = me.[comboBox].column(2)
etc.

if you keyfield in the query for you combo box is in the fist position then
adjust the column numbers accordingly. column numbers start with 0



LG said:
If I have a form built with agency, address, city, state, zip all in
different fields.
What I would like to do is if the processor types an agency it will provide
a list from a seperate table and auto populate the remaining fields.
EX.
Sesame Place is the agency the drop down box is provided with 1234 bigbird,
lancaster, pa, 19011 and once clicked it would auto populate the correct
fields in the form.
Is this possible?
 
J

John W. Vinson

If I have a form built with agency, address, city, state, zip all in
different fields.
What I would like to do is if the processor types an agency it will provide
a list from a seperate table and auto populate the remaining fields.
EX.
Sesame Place is the agency the drop down box is provided with 1234 bigbird,
lancaster, pa, 19011 and once clicked it would auto populate the correct
fields in the form.
Is this possible?

If you're trying to store the address, city, state, and zip fields redundantly
in a second table.... DON'T!

It wastes space and will *usually* not be necessary. Just store the AgencyID
and use the method below to display the agency's current information.

If you need to record (say) the address that existed at a particular point in
time, and have it stay the same even if the agency moves, then you can push
the data into the fields; but normally you can instead just omit these fields
from your second table altogether, and display the info on the form with
textboxes with control sources like

=comboboxname.Column(n)

where n is the zero based index of the field you want to display (e.g. if the
zip is the fifth field in the combo's row source query use (4) to show it).
 
L

LG

Currently they enter the data manually so it is in the fields in the table
and I am not sure if we are able to get away from that. I also have another
query running to fill in other fields and than it goes to a mail merge. Is
it possible to have 2 queries to produce 1 mail merge?

SuzyQ said:
hopefully your addressTextBox and cityTextBox are unbound controls used for
display purposes, because you don't need to store that can query.

SuzyQ said:
yes
Assuming your combo box has fields [agency], [address], [city], [zip],
[keyfield] in the after update event for the combo box put the following code

me.[addressTextBox] = me.[comboBox].column(1)
me.[cityTextBox] = me.[comboBox].column(2)
etc.

if you keyfield in the query for you combo box is in the fist position then
adjust the column numbers accordingly. column numbers start with 0



LG said:
If I have a form built with agency, address, city, state, zip all in
different fields.
What I would like to do is if the processor types an agency it will provide
a list from a seperate table and auto populate the remaining fields.
EX.
Sesame Place is the agency the drop down box is provided with 1234 bigbird,
lancaster, pa, 19011 and once clicked it would auto populate the correct
fields in the form.
Is this possible?
 
Ad

Advertisements

N

niki4152

LG said:
If I have a form built with agency, address, city, state, zip all in
different fields.
What I would like to do is if the processor types an agency it will
provide
a list from a seperate table and auto populate the remaining fields.
EX.
Sesame Place is the agency the drop down box is provided with 1234
bigbird,
lancaster, pa, 19011 and once clicked it would auto populate the correct
fields in the form.
Is this possible?
sony ericsson BEST))))
 
Ad

Advertisements


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

Similar Threads

Drop down boxes 1
Complicated possible list box 3
Auto Populate Fields 3
Auto fill fields 3
Auto fill in 1
Comparing Tables 1
Populate combo field on form 4
Auto-Populate Combo Box. 15

Top