Forms-comboboxes and subform

T

train.fan#007

Hi Guys,
I hope someone can help:

I have a form with various textboxes(not this problem),
1 comboBox(cboMakers),
1 comboBox(cboModels),
and a subform showing(hopefully) a table of available parts.

I have a table of Makers:- fields Optionnumber and MakersName
I have a table of Models:- fields OptionMakersNumber, OptionModelNumber and
OptionModelName.

The Relationship between OptionNumber and OptionMakerNumber is One-to-many,
this has the desired result within the tables, but as to how this would
work within the form baffles me.

To explain what I am trying to achieve:-

I would like to select one item from cboMakers(47 available choices),
on selection and tab to cboModels, the individual models appear in
cboModels(ranging from 2 to 60 in number).

Example of what I hope to see:-
cboMakers "AC" Selected
cboModels (list of 7 items ie Models of AC cars)"" on selection eg "Cobra",
The table would show what parts are available for a Cobra.

This would then follow on to the Subform where tblParts should show a list
of available parts to each model.

The list of Parts runs to 100 at the moment, for all models.

Am I being too adventurous or am I missing something really simple.

Thanks in advance

Lindsay (TrainFan#007)
 
G

Guest

Hi train.fan,

In the after update event of cbomakers have;

If Not Isnull(Me.cboMakers) Then
Me.cboModels.RowSource = "SELECT * FROM [table of models] WHERE
OptionMakersNumber = " & Me.cboMakers & "")
End If

This will populate the second combobox, provided the bound column for the
first is OptionNumber, if it isn't currently, then make it the first column,
set it's width to 0 to hide it, then the code will work. If you do the same
for the second combobox regards bound column = OptionModelNumber, and use
that as the Link Master Field for you r subform, it should automatically
update to show all parts for the model selected.

hope that helps,

TonyT..
 
T

train.fan#007

Thanks very much Tony
I will try your idea tommorrow.

Thanks again
Lindsay(TrainFan#007)
 

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