M
Matthew
Hello,
I'm having a hard time removing a filter.
Form 1 has a combo box, to select a person. AfterUpdate of this Combo1:
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[ContactID] = " & Str(Me![Combo1])
Me.Bookmark = rs.Bookmark
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Form2"
stLinkCriteria = "[ContactID]=" & Me![ContactID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Form2 also has a combo box which I use to find records on that form. Combo2
AfterUpdate:
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[ContactID] = " & Str(Me![Combo2])
Me.Bookmark = rs.Bookmark
If I were to open Form2 from scratch, it shows me that I'm on record 1 out
of 3,000, and Combo2 works just fine.
However, if I use Form1 Combo1 to open Form2, it opens filtered to record 1
of 1. Now Combo2 won't work.
I've tried inserting various code in Combo2 BeforeUpdate, including
Me.Combo2 = Null
or
Me.Filter = ""
or
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 3, , acMenuVer70
These don't work.
What does work is if I create a button on the form, with the following
'remove filter' code:
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 3, , acMenuVer70
But having to have my users press a Remove Filter button is way too klunky.
There's got to be a way to make this work. Any suggestions are most
appreciated!!
Thanks!
Matthew
I'm having a hard time removing a filter.
Form 1 has a combo box, to select a person. AfterUpdate of this Combo1:
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[ContactID] = " & Str(Me![Combo1])
Me.Bookmark = rs.Bookmark
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Form2"
stLinkCriteria = "[ContactID]=" & Me![ContactID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Form2 also has a combo box which I use to find records on that form. Combo2
AfterUpdate:
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[ContactID] = " & Str(Me![Combo2])
Me.Bookmark = rs.Bookmark
If I were to open Form2 from scratch, it shows me that I'm on record 1 out
of 3,000, and Combo2 works just fine.
However, if I use Form1 Combo1 to open Form2, it opens filtered to record 1
of 1. Now Combo2 won't work.
I've tried inserting various code in Combo2 BeforeUpdate, including
Me.Combo2 = Null
or
Me.Filter = ""
or
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 3, , acMenuVer70
These don't work.
What does work is if I create a button on the form, with the following
'remove filter' code:
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 3, , acMenuVer70
But having to have my users press a Remove Filter button is way too klunky.
There's got to be a way to make this work. Any suggestions are most
appreciated!!
Thanks!
Matthew