Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Microsoft: Access Other topics FAQ

Access Howto:

Dependent Combo Boxes by Bullschmidt
Posted: 22 May 03 (Edited 23 Jun 03)

Have you ever wanted to have a second combo box (perhaps listing products) based on another combo box (perhaps listing companies)?  Thus after the user chooses a company, he then sees only the products for that company in the second combo box.

For criteria in the 2nd combo box (and to get to the query design mode of the combo box click on the 3 dots just to the right of the combo box's RowSource property):
Like [Forms]![MyForm]![MyFirstComboBox]

And for the OnEnter property of the 2nd combo box:

And in any module:
Public Function ctlRequery()
    ' Purpose:  Use this in OnEnter property of a combobox that's based on another control
    '           that may have changed or based on records that may have changed
    '           since the form was first opened.

    On Error GoTo Err_ctlRequery
    ' Dim var.
    Dim ctl As Control

    ' Set var.
    Set ctl = Screen.ActiveControl

    ' Requery control.

    Exit Function

    Exit Function

End Function

For an example of dependent combo boxes you can download my sample invoices database currently at the link toward the bottom of http://www.bullschmidt.com/login.asp and then on the Invoices Dialog check out the Invoice # combo box which is based on the Rep # combo box.

J. Paul Schmidt, Freelance Access and ASP Developer
http://www.Bullschmidt.com/Login.asp - Database on the Web Demo
http://www.Bullschmidt.com/Access - Sample Access Invoices Database

Back to Microsoft: Access Other topics FAQ Index
Back to Microsoft: Access Other topics Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close