Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2009
    Posts
    6

    Red face Unanswered: Form: can I make the contents of a combo dependent on a previouse combo?

    Using Access 2007. I have a form that has a couple of combo boxes. The first combo contains a list of the jobs in process by the company. The second combo contains all of the purchase orders for all of the jobs. My issue is that I want the second combo box to display only the purchase orders for the job (number) selected in the first combo box. Both of the tables (job and purchase order) have the job number. I am new to Access 2007 and have not written any code yet. TIA.
    Last edited by dcsmith1076; 04-03-09 at 03:12.

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Yes you can.

    On the AfterUpdate event of the first combo (the "master" combo) write some code to change the RowSource property of the second combo (the "slave" combo) then requery it, like this:
    Code:
    Private Sub Combo_Master_AfterUpdate()
    
        Me.Combo_Slave.RowSource = .....
        Me.Combo_Slave.Requery
        
    End Sub
    Have a nice day!

  3. #3
    Join Date
    Sep 2006
    Posts
    265
    Your PO combibox rowsource should look like:

    Code:
    "SELECT PurchaseOrders.[PO_ID] ... FROM PurchaseOrders WHERE PurchaseOrders.[Job_ID]= " & .[Job] & " ORDER BY PurchaseOrders.[PO_ID];"
    Either on Job combi AfterUpdate or combi PO OnEnter do a Requery on PO.

    Simon

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •