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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Filtering RecordSource through VBA in MS Access Forms

  • 10-01-2007 12:39pm
    #1
    Registered Users, Registered Users 2 Posts: 24,367 ✭✭✭✭


    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: 41,235 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, Registered Users 2 Posts: 24,367 ✭✭✭✭Sleepy


    Cheers kbannon. Works like a dream.


  • Moderators, Politics Moderators Posts: 41,235 Mod ✭✭✭✭Seth Brundle


    no problem
    just stick the cheque in the post!


Advertisement