locked
Form Criteria RRS feed

  • Question

  • Trying to set criteria for a field on a form based on the selection made in another field on the same record in the form.  Specifically:

    The database includes a sales order header table and a sales order detail table.  In the form we are entering in additional information to a third table that pertains to the sales order details.  I have a combo box set up to select a sales order number from a sales order query.  The next field on the form is for the Item ID and currently lists all items on all sales orders.  We would like to set the criteria so that only the items from the selected sales order are included in the list from the combo box.

    Sales Order Query includes:

    Reference (Sales Order No) / Description / Post Order (field for linking to Sales Order Details)

    Sales Order Detail Query includes:

    Item ID / Reference (Hdr) / Post Order (field for linking to Sales Order Header)

    Saturday, December 30, 2017 2:01 PM

All replies

  • ciao Drscpa,

    cascading combo boxes then.

    you have to revise the sql combo box itemID predicate applying a where clause basing on the result of the combo where you select the orders :

    SELECT [Sales Order DetailTable].[Item ID] FROM [Sales Order DetailTable] WHERE  [Sales Order DetailTable].[Post Order]=[forms]![yourFormName]!cboPostOrder;

    and then after event of combo Box order :

    Private Sub order_AfterUpdate()

        Me.cboproducts.Requery

    End Sub

    HTH.

    ciao, Sandro.


    Saturday, December 30, 2017 2:31 PM