Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

filter on a form

Status
Not open for further replies.

kmayo503

MIS
Jun 21, 2003
70
0
0
US
I had a filter on a form that was working great. it would sort all my records based on a field (SALESREPNum) I had been using it for weeks. I ran several reports yesterday and changed two other fields that are not linked to this field and all of a sudden the filter stopped working.
"The expression on click you entered as the event property setting produced the following error: The expression you entered refers to an object that is closed or doesn't exist"

here is the filter.
Dim strFilter As Stringstr
Filter = InputBox("Enter SalesRep #")

If Len(strFilter & "") > 0 Then DoCmd.ApplyFilter "", "SalesRepNum=" & CLng(strFilter)
End If

Nothing has changed with the field that holds the info.
 
While the changes you made may have not been directly tied to the filter field, they may have been part of a relationship with another table or query. That would give you the same error message as a result. I would check the relationships with the form and the underlying queries and see if there are any calls to those changed fields. Hope this helps.

Michael
BASD IS/IT Dept
 
i ended up creating a new form and it worked to elliminate the other problems that i was having. when i compared the two there was no difference the relationships were the same the only difference was it worked. the properties were the same and the tables were set the same. i can't figure it out. either way it worked out just fine. thats for the help i will remember to check relationships in the future. i think it was a visual basic corruption. the debugger kept running and running everytime i opened the program. as soon as i deleted the filter and replaced it with a copied version of the same one it worked. got me, but it is running smoothly now. thanks ever so much for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top