Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Access Question

  • 08-06-2003 11:21AM
    #1
    Closed Accounts Posts: 23


    I am building a database of my bike club and have sucessfully created a combo box on the data imput form with a drop down list of bike makes. (I used the combo box wizard & took the data from a table)

    Is there an easy way of then having the next field (for models)display a list of models dependant on what was selected in the makes field? e.g if Honda is selected, a list of all Honda models is displayed.



    Or am I being too ambitious for a beginner? :rolleyes:


Comments

  • Registered Users, Registered Users 2 Posts: 44 3D


    For a beginner you may be being a bit ambitious.

    However here is the outline of how to do what you are asking.

    You have your combo box "Manufacturer" and in this you choose a manufacturer eg Honda - this is based on the Manufacturer table. You have a second combo box "Model" and this has a list of all the Models eg CBR900. The second combo box is based on a seperate table called Model and there is a relationship of one to many between these tables (One manufacturer can have many models) based on ManufacturerID

    The second combo box is based on a select statement from the model table with a where clause that specifies the manufacturerID is equal to the manufacturerID choosen the the combo box before - the syntax looks like this in the criteria cell of the query:

    forms![formname]![fieldname]

    Where the formname is the form the combo boxes are on.
    and the fieldname is the relationship field between the two tables ie ManufacturerID.

    The last thing you have to do is put a requery on the OnChange event of the "Manufacturer" combo box - this requeries the whole form and the sql on the second combo box so only returning the models with the specific ManufacturerID choosen.

    Its actually quite easy to do - but quite hard to explain - you do need to understand how combo boxes are built without a wizard to be able to make the changes outlined above.


  • Closed Accounts Posts: 23 Young Sid


    Thanks for that, now I'll give it a go...watch me balls up me database royally!!!!:rolleyes: :D

    Thanks again


  • Registered Users, Registered Users 2 Posts: 44 3D


    Let me know if you have any problems and we'll see if we can get them sorted:D


Advertisement