Lookup Help

G

Guest

This is my first time creating a form, I want to created a textbox that will show a list of choices for the user to pick from based on the user initial choice. Example

If a user in the first choice choose Dessert in the fist drop down box, I want the second drop down box to show the following choices (Pie, ice-cream, Milk Shake, etc). Now if the user choose appetizer in the first dropdown box, I want the second drop down box to show (chicken finger, chicken wings, Fries, onion rings,etc)…. I am struggling to have the second drop down box to show a different list based on the first drop down box choice. I have the list from the drop down box in a single table with 2 field, first field called Menu that show the first drop down box list (ie. Dessert, Appetizer) and second field called Choices showing the second drop down list (Chicken finger, pie, icecream). I am familiar with a dlookup but not sure how to get the second list box to look up a different list based on different choice enter from the first drop down box. Any help is appreciated!
 
R

Rick

In the Row Source Type of the second box select table/query. In the row
source, use the '...' button to create a query. in the query pull the two
fields from your table. Under menu, uncheck the 'show' box. in the
criteria put

Like [forms]![FormName].[DropDownFieldName] & "*"

Using this will allow all choices to be pulled if the 'menu' box is blank.
If you would prefer that not to be an option, then put

[forms]![FormName].[DropDownFieldName]




Hope this helps.

Rick


Lisa C said:
This is my first time creating a form, I want to created a textbox that
will show a list of choices for the user to pick from based on the user
initial choice. Example:
If a user in the first choice choose Dessert in the fist drop down box, I
want the second drop down box to show the following choices (Pie, ice-cream,
Milk Shake, etc). Now if the user choose appetizer in the first dropdown
box, I want the second drop down box to show (chicken finger, chicken wings,
Fries, onion rings,etc).. I am struggling to have the second drop down box
to show a different list based on the first drop down box choice. I have the
list from the drop down box in a single table with 2 field, first field
called Menu that show the first drop down box list (ie. Dessert, Appetizer)
and second field called Choices showing the second drop down list (Chicken
finger, pie, icecream). I am familiar with a dlookup but not sure how to
get the second list box to look up a different list based on different
choice enter from the first drop down box. Any help is appreciated!
 
G

Gerald Stanley

In the AfterUpdate event of the first listbox, you need to
set the RowSource of the second listbox e.g.

Private Sub {yourfirstlistbox}.AfterUpdate()

{yoursecondlistbox}.RowSource = "SELECT Choices FROM
{yourtablename} WHERE Menu = " & {yourfirstlistbox}.Value

End Sub

Obviously you will have to substitute your own names for
the items in {}.

Hope That Helps
Gerald Stanley MCSD
-----Original Message-----
This is my first time creating a form, I want to created a
textbox that will show a list of choices for the user to
pick from based on the user initial choice. Example:
If a user in the first choice choose Dessert in the fist
drop down box, I want the second drop down box to show the
following choices (Pie, ice-cream, Milk Shake, etc). Now if
the user choose appetizer in the first dropdown box, I want
the second drop down box to show (chicken finger, chicken
wings, Fries, onion rings,etc)â?¦. I am struggling to have
the second drop down box to show a different list based on
the first drop down box choice. I have the list from the
drop down box in a single table with 2 field, first field
called Menu that show the first drop down box list (ie.
Dessert, Appetizer) and second field called Choices showing
the second drop down list (Chicken finger, pie, icecream).
I am familiar with a dlookup but not sure how to get the
second list box to look up a different list based on
different choice enter from the first drop down box. Any
help is appreciated!
 

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