FileDialog persists previous filters

Viewed 280

I am making form in Access database I need to open file dialog window few times. I just don't get why after I change option value for a few times and open file dialog window it didn't change filters.

Public Sub Command17_Click()
Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogOpen)
    With fd
        .AllowMultiSelect = False
        If Option18.Value = True Then
         .Filters.Add "Access", "*.accdb", 1
        Else
        If Option20.Value = True Then
         .Filters.Add "Excel", "*.xlsx", 1
        End If
        End If
        .Show

 Text0.Value = fd.SelectedItems(1)
    End With
    Set fb = Nothing
End Sub
1 Answers
Related