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

Set Filter in Calling Form....HELP!!!

Status
Not open for further replies.

Callreluctance

Technical User
Jan 3, 2003
25
US
I am really having a devil of a time finding a FAQ or post that will set a filter on the current record to restrict it to a set of records that match a criteria. I want the user to be able to type in text to basically search or limit the records to that text, ie LastName, Company, or SalesID. I want the same interface (form) that they were using before to be shown, only have the records restricted to what the query or filter or whatever returned. The FAQs that I saw related to pulling a query this way, but not returning the query data to the original form and restricting the data. HELP!!
 
It sounds like what you are trying to do is "filter by form".

If you right click on any field in a form there is a choice of "Filter for" just type in the text box to the right of that, your criteria and then only the records that meet that criteria will be available.

When you want to show all records again, simply right click and select "Remove Filter/Sort".

These selections are also available on the "Form View" toolbar.

Good luck
 
Not exactly what I am trying to do. I want to make this very user friendly. The users who are working with the forms will have no concept of Access, in fact a right click might be stretching it. I need buttons, and buttons that would not normally appear in access, as I will be disabling most of that stuff.
 
While I'm no expert in this, you can set the filter property of the form to a string like:


dim strFilter as string
strFilter = "[EmployeeID]=" & me!employeeID

me.filter = strFilter
me.filteron = true


This would filter everything in the current form to match the employee ID, which could be none, 1 or many depending on the recordset.

Regards

Lou

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top