Hi,
I have a continuous form.
It is mostly filtered via a text box at top, ie. I type a surname
The Recordsource Query (although SQL in the RS & not sep query)
then filters the form from the query that has
Like [Forms]![MainForm]![surname] & '*'
works fine.
I also have a search textbox to find anything else on the form & a variety of other searches
This uses
Me.Filter = "([RegID] = " & Me!RegID & ")"
or
DoCmd.ApplyFilter , Me.Filter = "([RegID] = " & Me!RegID & ")"
I use a variety, I know me.Filter = .. is better than docmd but both work & sometimes neater.
This again is fine & they both work seperately but when I want to reset the form I can never properly refresh the main query to change the surname. it clear the list but never filter after, I type a name & the list remains full.
I set surname = ""
requery
refresh
For the query
me.filter = ""
me.filteron = false
to clear any extra filters.
I think the filter part is OK but I suspect if a separate query and I was to apply by name it might work.
On the form, rather than unfiltered (which it show or filtered) it now shows No Filter.
Simply can't get it to work.
tried me.filteron=true just so it is on with no filter set, requery & many combinations
I did change the recordsource sql but got very messy with so many different fitlers I wanted to use on the form and when I changed the table it was a real pain changing all the RS everywhere.
I am thinking having default RS and setting this but again trying to get way from that.
Any ideas how to simply requery the mainform
I have a continuous form.
It is mostly filtered via a text box at top, ie. I type a surname
The Recordsource Query (although SQL in the RS & not sep query)
then filters the form from the query that has
Like [Forms]![MainForm]![surname] & '*'
works fine.
I also have a search textbox to find anything else on the form & a variety of other searches
This uses
Me.Filter = "([RegID] = " & Me!RegID & ")"
or
DoCmd.ApplyFilter , Me.Filter = "([RegID] = " & Me!RegID & ")"
I use a variety, I know me.Filter = .. is better than docmd but both work & sometimes neater.
This again is fine & they both work seperately but when I want to reset the form I can never properly refresh the main query to change the surname. it clear the list but never filter after, I type a name & the list remains full.
I set surname = ""
requery
refresh
For the query
me.filter = ""
me.filteron = false
to clear any extra filters.
I think the filter part is OK but I suspect if a separate query and I was to apply by name it might work.
On the form, rather than unfiltered (which it show or filtered) it now shows No Filter.
Simply can't get it to work.
tried me.filteron=true just so it is on with no filter set, requery & many combinations
I did change the recordsource sql but got very messy with so many different fitlers I wanted to use on the form and when I changed the table it was a real pain changing all the RS everywhere.
I am thinking having default RS and setting this but again trying to get way from that.
Any ideas how to simply requery the mainform