insert record from list box to table do i need to use vba

J

jeremy0028

ok i have a main form called frmpeople. which has the following
txtcity, txtstate, cmbzip
i have another form for the list box called frmzipcodesearch with the
following code in
the row source for the list box which is called list0

SELECT tblPeople.PersonID, tblPeople.City, tblPeople.State,
tblPeople.Zip
FROM tblPeople;

sometimes a city could be associated with duplicate zipcodes

example

Montery Park 91106
Montebello 91106

what i want to do is if a user enters a zipcode that is associated
with more the one city the form
called frmzipcodesearch will pop up asking user to select correct city
user double clicks the city from the list box and it will insert that
record into the form or table called tblpeople.


Can anyone help

Thanks In advance.
 
S

Smartin

ok i have a main form called frmpeople. which has the following
txtcity, txtstate, cmbzip
i have another form for the list box called frmzipcodesearch with the
following code in
the row source for the list box which is called list0

SELECT tblPeople.PersonID, tblPeople.City, tblPeople.State,
tblPeople.Zip
FROM tblPeople;

sometimes a city could be associated with duplicate zipcodes

example

Montery Park 91106
Montebello 91106

what i want to do is if a user enters a zipcode that is associated
with more the one city the form
called frmzipcodesearch will pop up asking user to select correct city
user double clicks the city from the list box and it will insert that
record into the form or table called tblpeople.

Can anyone help

Thanks In advance.

Yes, VBA is your friend. You can capture the After_Update event, run a
query that figures out if a city selection is required, and fire up
the new form as needed. You will need to use VBA as well to capture
the city selection and pass the result back to the main form (or
update the underlying table).
 

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