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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Filter For" menu item and filtering? 1

Status
Not open for further replies.

knovak

Programmer
Dec 18, 2001
17
US
If a user right-clicks on a field and enters criteria in the "Filter For" box, how do I keep them on the same record if the criteria they enter is not in the current record set. I can't find any examples on MSDN that do this.

Thanks,

Kyle
 
This should do the trick...

Private Sub Form_ApplyFilter(Cancel As Integer, ApplyType As Integer)

If DCount("*", Me.RecordSource, Me.Filter) = 0 Then Cancel = True

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top