Full Version: Open A Form With Filter Off, From Another Form
UtterAccess Forums > Microsoft® Access > Access Forms
kevinlaw
Hello UA,
I've got a form that, with a command button, opens another form and I need to make sure the form that is opened has its filter off. The first form is closed as this happens.
can't figure out the right way to turn the filter off. I've put Me.FilterOn= false in the code but it's either not in the right place or is not worded right. Does anyone know the correct way to do this?
I've got in the OnClick of the first form's command button:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "myFormToOpen"
Me.FilterOn = False
DoCmd.close acForm, Me.Name
DoCmd.OpenForm stDocName, , , stLinkCriteria
theDBguy
Hi,
Try it this way:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "myFormToOpen"
DoCmd.close acForm, Me.Name
DoCmd.OpenForm stDocName, , , stLinkCriteria
Forms(stDocName).FilterOn = False
(untested)
Hope that helps...
kevinlaw
Works like a charm- thanks DbGuy!
theDBguy
Hi,
Glad we could help. Good luck with your project.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.