Navigate to Open a form and Unfilter if prev. Filtered

B

babs

I have 2 command buttons on a form to Navigate to another form Jeff Employee
Info with Sched. the One filters based on employee(That works great)

The other one I want to Navigate to the Jeff Employee Info with Sched.
UnFiltered to See ALL records - Code is Below
If the form is previously NOT filtered it works great but if it Had Been
filtered It opens up filtered

I added this code (Me.FilterOnLoad = False) hoping that it would UNFILTER
when opened but doesn't - I have to Manually unfilter it but do not want to
have to do this - what code can I add below to make it open Unfiltered??



Private Sub Command11_Click()
On Error GoTo Err_Command11_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Jeff Employee Info with Sched"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Maximize
Me.FilterOnLoad = False
Exit_Command11_Click:
Exit Sub

Err_Command11_Click:
MsgBox Err.Description
Resume Exit_Command11_Click

End Sub

Thanks,
Barb
 
J

John Spencer

Try changing
Me.FilterOnLoad = False

To
FORMS(StDocName).Filter = vbNullString
FORMS(StDocName).FilterOn = False



John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top