Results 1 to 7 of 7
  1. #1
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Youngstown, Ohio, USA
    Posts
    705
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Limited Combo Box

    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. <img src=/S/bummer.gif border=0 alt=bummer width=15 height=15> Any suggestions?

  2. #2
    3 Star Lounger
    Join Date
    Feb 2001
    Location
    NYC,USA,Earth
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Limited Combo Box

    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.

  3. #3
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    USA
    Posts
    379
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Limited Combo Box

    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.

  4. #4
    3 Star Lounger
    Join Date
    Feb 2001
    Location
    NYC,USA,Earth
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Limited Combo Box

    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.

  5. #5
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Limited Combo Box

    Dear David,

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

  6. #6
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Limited Combo Box

    Dear Paul,

    You are correct, the first combo

  7. #7
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Youngstown, Ohio, USA
    Posts
    705
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Limited Combo Box

    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. <img src=/S/bow.gif border=0 alt=bow width=15 height=15>

    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. <img src=/S/groovin.gif border=0 alt=groovin width=21 height=21>

Posting Permissions

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