Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Filtering RecordSource through VBA in MS Access Forms

Options
  • 10-01-2007 1:39pm
    #1
    Registered Users Posts: 24,249 ✭✭✭✭


    I'm trying to filter the recordset shown in an MS Access Database form when the value of an unbound combo box is changed. I'm not getting any errors when I test it but the recordset displayed isn't changing at all.

    Can anyone see what I'm doing wrong here?
    Private Sub SelectBranch_Change()
        Dim strFilter As String
        strFilter = "SortCode = '" & SelectBranch.Value & "'"
        Form.Filter = strFilter
        Form.Refresh
    End Sub
    


Comments

  • Moderators, Politics Moderators Posts: 39,821 Mod ✭✭✭✭Seth Brundle


    Private Sub SelectBranch_Change()
        Dim strFilter As String
        strFilter = "SortCode = '" & SelectBranch.Value & "'"
        Form.Filter = strFilter
        Form.Filteron = true
        Form.Refresh
    End Sub
    


  • Registered Users Posts: 24,249 ✭✭✭✭Sleepy


    Cheers kbannon. Works like a dream.


  • Moderators, Politics Moderators Posts: 39,821 Mod ✭✭✭✭Seth Brundle


    no problem
    just stick the cheque in the post!


Advertisement