drilling down

  • Thread starter Thread starter Dave Smith
  • Start date Start date
D

Dave Smith

hi, i need to make something where i have a combo box with "car makes"
listed, i click on say, "toyota", and a second combo box becomes visible,
with all the "toyota" brand models are listed (not all the fords,
mitsubishis etc..) and so on until i come to a particular vehicle at which
point i will need to display relevant info on that vehicle.

my main concern at this stage is how best to do the first part with the
combo boxes, eg, i think i can use a single table, for each combo box, and
somehow use the relationships to limit the vehicles in the second combo box
to only display the selected make? (i want to click on the "make" in the
first combo box.)

thanks in advance,

Dave
 
thanks for that, i'm a bit confused though...

read the text....


Let's say you have two comboboxes, cbxCombo1 and cbxCombo2. The
RowSourceType of cbxCombo1 is set to "Field List" and RowSource to a table
CATEGORY. cbxCombo2 doesn't have anything under RowSource.

In this case, you can put code in the AfterUpdate event of cbxCombo1
that assigns the proper RowSource to cbxCombo2.

'**************** Code Start *************
Private Sub cbxCombo1_AfterUpdate()
Dim strSQL As String
strSQL = "Select " & Me!cbxCombo1
strSQL = strSQL & " from CATEGORIES"
Me!cbxCombo2.RowSourceType = "Table/Query"
Me!cbxCombo2.RowSource = strSQL
End Sub
'**************** Code End *************Where it talks about a "table
category" (i capitilised it) is it saying i have to create another table
with the CarMakes i want? if it is supposed to find a list of fields in a
table and the author of this page has used the word "category" to imply
that, what is the correct code to point it in the right direction? if i am
supposed to select something that actually says "table category", where is
that?

i cant seem to get it to do what i expected it to do, as setting the
RowSourceType to "field list" only brings up, well...the field list.
 
scratch that, i now realise that the second part of his advice was actually
a second (and easier) way of doing it rather than the second half of the
first bit....

cheers for your time
 

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

Back
Top