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!

Remove Forms Filter Sort

Status
Not open for further replies.

sqlJunior

Technical User
Sep 22, 2002
123
TH
I am using the AfterUpdate event of a forms combo box to allow users to go to the selected record (it uses the rsClone.FindFirst).

It works fine when the form is opened with a complete recordset.

However, sometimes the form is opened from a link on another form and in such cases it then returns a filtered set of records.

In such case the combo box does not allow the user to go to a record which is not included in the filtered set.

How can I get the combo box to remove the forms filter sort before it actually tries to go to the selected record.

I should add that the combo box menu is derived from a query that will return a list of all the records regardless of the filter that is applied to the form
 
I have a single form that serves as a single record filter and an entire record set view. I used the "DoCmd.ShowAllRecords" before the search code to make sure that all the records were visible before executing the search in the event that the filter was on and an user tried to use the search combo. It seemed to remove the filter fine. If anyone else knows a better way I'd also like to know.

DoCmd.ShowAllRecords
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[ID] = " & Str(Nz(Me![Combo41], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
 
This will probably work a little easier

Private Sub CmbWhatever_AfterUpdate()
Me.FilterOn = False
your code
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top