I need to Form B based on info selected in Form A. After a user enters the selection criteria, they hit the 'ok' button. In the Click event of the 'ok' button, I do a
If Nz(Forms("frmParameterEntry-Students").Controls("Zip"), 0) <> 0 Then
If strWhere <> "" Then strWhere = strWhere & " And "
strWhere = strWhere & "[Zip] Like " & Forms("frmParameterEntry-Students").Controls("Zip") & "*"
If when Form B is opened, it contains all the records, not just the filtered records. So, then I tried doing the filtering on the Form B itself. I went to the Filter property for the form and did the same logic with all sorts of variations for handling the strings (Zip is a text field)
Zip Like "98*"
"Zip Like '98*'"
"tblStudents.Zip Like '98*'"
Same problem. All records returned. Am I missing something fundamental about filtering?
Originally posted by cranconsult
Basically, my forms aren't filtering, whether I filter in code or through the Filter Property of the form. AllowFilter is set to YES, but still no luck. Any ideas on why this might be?
Real simple : if you set the filter on a form, it is automatically loaded but it is not applied. To see the effect of the filter, you must apply it, either by using the menucommand <Records><Apply Filter / Sort> or in code by setting the FilterOn property to True.