Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Access Question

Options
  • 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 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 Posts: 44 3D


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


Advertisement