View Full Version : Category and sub category


Juffled
07-06-2006, 08:13 AM
Trying to make up a pricing database for jobs

for instance if we have

Bonds : 15mm//17mm//20mm

Downtape : copper // aluminium

I want a drop down box where you select the category Downtape or bonds, then another drop down box showing all the possible choices for bonds if you selected bonds, but wont show you any of the down tape options.

I have been trying to work out the relationships here and been getting in a muddle so any help would be much appreicated.

Juffled

Malcy
07-06-2006, 11:02 AM
What you are looking for is called cascading combo boxes. You should be able to do a search and come up with good answers. They will only work if you get your data structures right.
One table for categories i.d. 1=Bonds, 2=Downpipes
One table for sub categories with field for the category and then the description i.e record 1 = 2 Copper Record 2 = 2 Aluminium
Hope this helps
Best wishes

Juffled
07-07-2006, 12:44 AM
Many thanks, I was sure it was possible however I did not know the name of what I was askig for which doesnt help :)

clerics
07-10-2006, 01:14 AM
Let see this code ! may be it helps you anyway :D

*Add this code below to Combo1 's AfterUpdate_Event

Me.Combo1.RowSource= " Select Bonds.ID,Bonds.Name from Bonds"

Combo1 (Event_afterupdate):

Dim strSQL as String
strSQL=" Select Downtape.ID,Downtape.Name from Downtape where ((Downtape.ID) = " & me.combo1 & ")"
me.combo2.RowSource=strsql