• Limited Combo Box

    • This topic has 6 replies, 4 voices, and was last updated 24 years ago.
    Author
    Topic
    #355801

    I have a table that contains [Route_Num] and [Cust_Num] for our delivery drivers. I would like to use this table in a form, with a drop-down combo box for each field. The [Route_Num] field would be the first to be selected. I would like to have the [Cust_Num] drop-down list filtered to be limited to only those serviced by [Route_Num].

    I have tried to send the value selected for [Route_Num] to a query to return the shortened list, and use this for the [Cust_Num] drop-down, but Access did not like my method. bummer Any suggestions?

    Viewing 3 reply threads
    Author
    Replies
    • #525496

      I’ve seen this done in the samples solutions db by using a parameter query or select statement as the row source for the second combo referencing the first combo. Then use the requery method on the second combo from the first combo’s after update event.

    • #525498

      One way to do it would be to make the Cust_Num dropdown unbound, setting it’s row source property to:

      SELECT YourTable.Cust_Num FROM YourTable WHERE YourTable.Route_Num = [Forms]![YourForm]![name of Route_Num dropdown];

      This will give you only the Customer Numbers whose Route Number is the same as the Route Number on the form. Depending on the contents of this table, you may have to use DISTINCTROW.

    • #525504

      Dear David,

      First! (I know its first because I typed the next line first then added this one!!!) Add a combo box

      • #525510

        You will still need to provide some method of updating the second combo once a route_no has been selected in the first combo. Refer to my earlier post using the requery method.

    • #525711

      Thanks all, I’ve managed to get it 95% working the way I had hoped to; just a few more bugs to work out and then to get it out into the field. bow

      To refresh the Cust_Num listing, I just used a Requery macro activated after Route_Num is entered.

      Now to adapt all of this to additional projects. groovin

    Viewing 3 reply threads
    Reply To: Limited Combo Box

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: