Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2006

    Unanswered: jumping ahead of myself?

    i have a form that allows a user to key a part number into a combo box, then i have another combo box right next to it that needs to be filtered to only display 1 of 3 options for that particular part (this field is for a secondary part number)

    IE: user selects part number 5565 and then the next field might have either 5565-ab6, 3458-gjd8, or 5603a but these 3 numbers can change per part.

    can someone help me out here, thanks in advance

  2. #2
    Join Date
    Jun 2005
    Richmond, Virginia USA
    Provided Answers: 19
    The concept is called Cascading Comboboxes., a great site, has this example:

    Scroll down and Click on: Filter one combobox based on another combobox selection?

    You can also download the zipfile example to the right of the listing.
    Hope this helps!

    The problem with making anything that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Join Date
    Sep 2003
    There's a couple of ways to do this:

    1) Reload/query the 2nd combo on the fly from the 1st combo's selection

    2) have the 2nd combo bound to a table/query with all possible items and when selecting from the 1st, filter the 2nd to only those related to the 1st. THIS can be done numerous ways too ... The way I like is to have the 2nd combo bound to a query where the underlying table has the Part, originating part, and a flag(boolean) for if visible/available.

    The 2nd combo's query looks like: SELECT * FROM MyTable WHERE (MyFlag=True) ORDER BY ... ;

    All you do is turn off everything and then turn on only those matching parts.
    This is usually done in the 1st combo's AfterUpdate event. Also, issue a requery on the 2nd combo afterward ...
    Back to Access ... ADO is not the way to go for speed ...

  4. #4
    Join Date
    Jul 2006
    well i used the code from databasedev and i put it in the afterupdate event, however now i get a "data type mismatch" error.

    heres the code im using:

    Dim NSN As String
    NSN = "SELECT [manafactures].[NSN], [manafactures].[1st part number], [manafactures].[2nd part number], [manafactures].[part number] " & _
    "FROM manafactures " & _
    "WHERE [NSN] = " & Me.NSN1.Value
    Me.PN1.RowSource = NSN

Posting Permissions

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