Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2004
    Location
    NY
    Posts
    113

    Unanswered: Filter from options in a subform combobox

    Hi, I am trying to filter a combo box located in a subform from a group of options in the main form. When I remove this line of code, I am getting choices in the combobox, however it doesn't filter

    Code:
    Private Sub grpGroupType_AfterUpdate()
        Me!sfrmTitle.Form.cboGroupSet.Value = Null
        Me!sfrmTitle.Form.cboGroupSet.Requery
    When I add it in, I get error messages.


    Code:
     
        On Error Resume Next
        Dim strCodeType As String
        
        
        
            Select Case grpGroupType.Value
            Case 1
                strCodeType = "1"
            Case 2
                strCodeType = "2"
        End Select
        
        
        Me!sfrmTitle.Form.cboGroupSet.Value = "Select tblGroupSet.GroupSetNo, tblGroupSet.GroupSetName " & _
            "FROM tblGroupSet " & _
            "WHERE tblGroupSet.GroupTypeNo = '" & strCodeType & "' " & _
            "ORDER BY tblGroupSet.GroupSetName;"
    ======================
    Levent
    Access 3

  2. #2
    Join Date
    Nov 2005
    Posts
    113
    Hi, try this

    Me!sfrmTitle.Form.cboGroupSet.rowsource = "Select tblGroupSet.GroupSetNo, tblGroupSet.GroupSetName " & _
    "FROM tblGroupSet " & _
    "WHERE tblGroupSet.GroupTypeNo = '" & strCodeType & "' " & _
    "ORDER BY tblGroupSet.GroupSetName;"

Posting Permissions

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