Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New to this please help

Status
Not open for further replies.

hawee8

Programmer
Joined
Apr 23, 2005
Messages
5
Location
US
Hi
I'm trying to create 2 drop down menus and have them related.
For example the first drop down menu would say TV, Medicine
Then for example if chose TV, the second drop box would show Sony, Panasonic,
or if i chose Medicine it would show Advil, Tylenol

can someone help me understand how to do this?
 
Hi there

You presumably have a table which has fields [ProductType] and [Manufacturer] for all the combinations. Your first drop-down menu sets the product type (say TV) your second drop-down menu would have the following SQL in the "RowSource" attribute. (set "RowSourceType" to "Table/Query")

Code:
SELECT tblProductManufacturer.Manufacturer
FROM tblProductManufacturer
WHERE (((tblProductManufacturer.ProductType)=[Forms]![YourFormName]![FirstDropMenuName]));

This will give you Sony, Panasonic etc.

Just an idea!

Regards

Tony
 
Hi
I'm using mircrosoft access, i dont see where i insert code? I'm just making a pretty basic database on the computer.
Thanks
Could you help me where i can insert code..?
 
hawee8,

tonyflavell already told you where to insert:

'in the "RowSource" attribute'

of your combo's properties.

Thorough reading the answers will get you closer to solving your problem than posting your question again in a different forum.

Double posting should only, if at all, be done with a reference to the other thread. That's why I redflagged your new thread for deletion.

You might want to look into:

How To Get Good Answers To Your Questions


TomCologne
 
Hi
I'm tryin to add this line of code to RowSource, but it will only allow me to add 1 line of code.

SELECT tblProductManufacturer.Manufacturer
FROM tblProductManufacturer
WHERE (((tblProductManufacturer.ProductType)=[Forms]![YourFormName]![FirstDropMenuName]));

 
So put it in as a single line of code - remove the hard returns.

Ken S.
 
Hi
I was trying it and can anyone made a sample access so i can take a look at it so i better understand.
please
thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top