List Box Synch

I

Issachar5

Hello, I am having problems. I need to synch two list box, I need the
following:
when a category is selected from list box A, only those results assign to A
will show up in List Box B. PLEASE HELP
 
A

Al Campagna

Issachar5,
Use the value of lstA to filter the results of lstB.
Use a query as the RowSource for lstB, and filter the Category...
Category
=Forms!frmYourFormName!lstA
Use the AfterUpdate event of lstA to Requery lstB, whenever
a value is selected in lstA... thus keeping them in sync.
--
hth
Al Campagna
Microsoft Access MVP 2007-2009
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
T

tonkaplayer

I used this approach I was wanting to enter a vehicle make and only get their
associated models. It requires two more tables which is updateable by a user
I think easier than editing a lookup list. It can present problems thought
(at least for me in creating reports) I did find a way around that but not
cleanly. I have not used the queries that way but does sound intersting that
Al suggests
http://office.microsoft.com/en-us/templates/TC102880861033.aspx?pid=CT101428651033&ofcresset=1
 
J

John W. Vinson

I used this approach I was wanting to enter a vehicle make and only get their
associated models. It requires two more tables which is updateable by a user

A table of Makes related one to many to a table of Models would be perfectly
appropriate; you would need maintenance tables to add new models or (less
frequently) new makes.
I think easier than editing a lookup list.

If you mean a "List of Values" combo box or listbox list, then by all means
use a Table instead. List of Values is appropriate only for very small,
totally static lists (e.g. "M";"F" or "Mr.";"Mrs."';"Miss";"Ms.").
It can present problems thought
(at least for me in creating reports) I did find a way around that but not
cleanly.

What problem did you have?? You would simply include the Make and Model tables
in the Query upon which the report is based.
 
T

tonkaplayer

I had a sub form based on table student cars
fields
date issues used to store date parking sitcker wa issued
Year of car
Make of car
Model of car
color
lic plate
comments

On the form the make and model fields were synchronized via the make and
model tables. However at first when I went to a second student and enter
data I change the make and model of the first student to wqhat had been
entered in teh first students records. I realized that my make and model
table were only "value lists for lookup purpose and not storing the data. I
change the bound property to my student cars table and all worked. Data
stored and recalled on my forms. However when I ran a report pulling fields
from my student cars table I got numbers in my make field. Not ford, Chevy
etc. I realized acces was storing the linked number between my make and model
table. I used the autonumber from make table and a number field in my model
table as the realtionship. I had to add code to the
row source property of the model number field and then instead of the number
showing the actual name of the make was then showing. I followed access help
file that is how to synchronize combo boxes examples. Thanks
 
J

John W. Vinson

On the form the make and model fields were synchronized via the make and
model tables. However at first when I went to a second student and enter
data I change the make and model of the first student to wqhat had been
entered in teh first students records. I realized that my make and model
table were only "value lists for lookup purpose and not storing the data. I
change the bound property to my student cars table and all worked. Data
stored and recalled on my forms. However when I ran a report pulling fields
from my student cars table I got numbers in my make field. Not ford, Chevy
etc. I realized acces was storing the linked number between my make and model
table. I used the autonumber from make table and a number field in my model
table as the realtionship. I had to add code to the
row source property of the model number field and then instead of the number
showing the actual name of the make was then showing. I followed access help
file that is how to synchronize combo boxes examples. Thanks

No. You did NOT need to add any code to the report. Storing the numbers is
correct.

What you can do - for a Report - is base the report, not on the table of cars,
but on a Query joining the table of cars to the table of Makes, by the MakeID;
and to the table of Models, by ModelID; you can then include the text name of
the make, from the Makes table, and the text name of the model, from the
Models table.

It sounds like you may have used the Lookup Wizard. Like many before you, this
obnoxious misfeature has deceived and misled you. Your table *appears* to
contain the make and model; it doesn't! It contains (as you saw) a numeric
foreign key. You just needed to take the next step, and base your report on a
query which does contain those names, rather than on a misleading table which
doesn't.
 

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