Connecting Tech Pros Worldwide Forums | Help | Site Map

creating a form that can select items and print them

Member
 
Join Date: Apr 2007
Posts: 99
#1: Dec 19 '08
Hello,
If I create two list boxes in microsoft access form.
The first list box lists Toyota, Honda, and Nissan.
The second list box depending on the first list box choice will list the models of car for that car.
example first list box choose: Toyota
second list box shows a list Corrola, Solara, Camry, and Tacoma.
Is there a way to make 3rd box and only add the models you want from the 2nd list box?
like Camry and Solara?
I have looked at cascading list boxes and cannot see how to do it?
I actually am trying to do something like the form wizard does when you create a form.
my last step i want to print out choices only I have made
Thank you

NeoPa's Avatar
Administrator
 
Join Date: Oct 2006
Location: London - UK
Posts: 15,730
#2: Dec 22 '08

re: creating a form that can select items and print them


The answer is "Not easily".

That is you could read the selected values from the .Selected array of the ListBox control and form those items into a filter string (of the form
Expand|Select|Wrap|Line Numbers
  1. [Make]='Toyota' AND [Model] In('Celica','Camry')
where 'Toyota' comes from the first ListBox and the 'Celica' and 'Camry' come from the second).

Have you seen Example Filtering on a Form? That may also give you some helpful ideas.
Member
 
Join Date: Apr 2007
Posts: 99
#3: Dec 22 '08

re: creating a form that can select items and print them


thank you - I am looking at what you suggested now-
NeoPa's Avatar
Administrator
 
Join Date: Oct 2006
Location: London - UK
Posts: 15,730
#4: Dec 22 '08

re: creating a form that can select items and print them


No worries - I hope you can make sense of it all :)

Certainly there are some useful concepts in there so you'll probably benefit from the exercise if nothing else.
Site Addict
 
Join Date: Mar 2007
Location: Oakland, California, USA
Posts: 522
#5: Dec 22 '08

re: creating a form that can select items and print them


I am attaching a simple program that does what is asked for here. It does not check for no entries or other errors, and will error if buttons are pressed when inappropriate.
This does build a list in a listbox based on selected items in another listbox. This is not a cascading combobox problem, although the first selection by user is in a combobox.
Table items per examples in initial post.

OldBirdman
ListBoxAssign.zip
Reply