Results 1 to 5 of 5
  1. #1
    ss2020 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2011
    Location
    Southern California
    Posts
    7

    Combo Box Not filtering

    I am creating a form to look up some data which will make an entry into another form. The 2nd look-up combo box, I can't get it to work.
    Detail:

    table -- dbo_POFOM

    Current Form -- F_MDF has 2 Unbound Combos


    Row Source Combo 1 [V_Name]
    select * from dbo_pofvm order by vendor_name
    This lets my user select the vendor to create the MDF

    I want this 2nd combo to pull the PO numbers that belong to the vendor the user selected above:

    Row sorce combo 2 [PO_num]


    Select dbo_POFOM.PO_ID FROM dbo_POFOM WHERE ((dbo_POFOM.VENDOR_NAME)=[Forms]![F_MDF]![V_NAME]) order by dbo_pofom.PO_ID

    When I take the where statement out, I can see all the PO numbers when I put the where statement in the cofield has no data. I have spent hours hitting my head agaist the wall and reading different posts. Nothing seems to help.

    Thanks in advance.

    Scott

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722

  3. #3
    ss2020 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2011
    Location
    Southern California
    Posts
    7

    Unhappy That did not work

    I am still not getting data in my 2nd combo box. I have used similar examples and tried these as well now.
    Not sure what else I can do. This seems straight forward and simple.

    On the 2nd code example I am getting a missing operator error and I don't see why. But it is picking up the vendor name, I can see that much.
    V-Name is the 1st combo box in the chain on F_MDF.

    Private Sub V_Name_AfterUpdate()

    Dim strSource As String

    strSource = "Select PO_ID" & _
    "FROM dbo_POFOM" & _
    "Where Vendor_Name = '" & Me.V_Name & "'Order By PO_ID"
    Me.PO_Num.RowSource = strSource
    Me.PO_Num = vbNullString

    S

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    This code
    Private Sub V_Name_AfterUpdate()

    Dim strSource As String

    strSource = "Select PO_ID" & _
    "FROM dbo_POFOM" & _
    "Where Vendor_Name = '" & Me.V_Name & "'Order By PO_ID"
    Me.PO_Num.RowSource = strSource
    Me.PO_Num = vbNullString
    needs some spaces
    Code:
    Private Sub V_Name_AfterUpdate()
    
    Dim strSource As String
    
    strSource = "Select PO_ID" & _
        " FROM dbo_POFOM" & _
        "Where Vendor_Name = '" & Me.V_Name & "'Order By PO_ID"
    Me.PO_Num.RowSource = strSource
    Me.PO_Num = vbNullString
    There is a space to the left of the characters in RED

  5. #5
    ss2020 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2011
    Location
    Southern California
    Posts
    7

    Thanks, that was it.

    Wow, I need to start wearing my glasses.

    Thanks.

    Scott

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Filtering records with a combo box
    By joesmithjunior in forum Access
    Replies: 1
    Last Post: 12-18-2011, 03:17 PM
  2. Error with filtering subform using 2 combo boxes
    By dharmacloud in forum Forms
    Replies: 4
    Last Post: 08-22-2011, 10:46 AM
  3. list form filtering from 1 combo box
    By cooper in forum Forms
    Replies: 5
    Last Post: 08-18-2011, 05:32 PM
  4. Combo Box Filtering between Forms
    By andrew_ww in forum Access
    Replies: 3
    Last Post: 12-30-2009, 11:06 PM
  5. Replies: 0
    Last Post: 08-17-2008, 12:19 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums