phoenxMan
asked on
Clearing filter on popup dialog form and reset to new value
I have setup a popup form to allow users to tag a list of pre-filtered values in a lookup reference table - code library. This works very well and will allow user to tag a set back to the openArg value from the event control source.
I need to either tag the list filtered or clear filter and use combo box to set a new filter.
See Screencast video on the issue.
http://screencast.com/t/Hu5t5ao6
Thanks
Ivan
I need to either tag the list filtered or clear filter and use combo box to set a new filter.
See Screencast video on the issue.
http://screencast.com/t/Hu5t5ao6
Thanks
Ivan
or call the Click event of the button that sets the filter.
ASKER
The under lining query for the popup has a criteria using Like filter on the recordset, verses setting the filter property
The combo box filter will change. I preferring to reset the filter property. But I get a request of parameter when I do this.
I believe if I get the correct syntax to reset after cbo update the filter on the forms property verses a like criteria on the SQL . This should work.
me.filter = Itemgroup &"=" & me.cbofiltergroup
but syntax is on the filter = Itemgroup = 'PatientNarrative'
How would you write the event to set this value back to the form filter property?
Thanks
The combo box filter will change. I preferring to reset the filter property. But I get a request of parameter when I do this.
I believe if I get the correct syntax to reset after cbo update the filter on the forms property verses a like criteria on the SQL . This should work.
me.filter = Itemgroup &"=" & me.cbofiltergroup
but syntax is on the filter = Itemgroup = 'PatientNarrative'
How would you write the event to set this value back to the form filter property?
Thanks
ASKER
clear the Filter property of the form in design view, save form
try just to requery the form
private sub form_load()
me.cboFilterGroup=myArg
me.requery
end sub
try just to requery the form
private sub form_load()
me.cboFilterGroup=myArg
me.requery
end sub
if that still fails try this
private sub form_load()
me.filter=""
me.cboFilterGroup=myArg
me.requery
end sub
private sub form_load()
me.filter=""
me.cboFilterGroup=myArg
me.requery
end sub
ASKER
Can the form filters be cleared and set dynamically in view mode?
I will try what you suggest.
But when I load the form I need to set a default value from the control name on the source event. Either to the form filter property or the the combo box filtering by SQL criteria.
I will try what you suggest.
But when I load the form I need to set a default value from the control name on the source event. Either to the form filter property or the the combo box filtering by SQL criteria.
ASKER
I tried setting the myArg to the combo after clearing the filter in design view. Still not setting the value (myArg) to the combo box.
upload a copy of the db
ASKER
It is a double click on the yellor Patient Narrative field to open the popup.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Not sure if I understand the if then logic. But it works.
Thanks a million.
Thanks a million.
ASKER
I tested the code and the openarg on other controls and found the filter is not released other than the first field use Patient Narrative. I check the code for changes you make to the openform filter and openarg settings.
See short video showing the difference. No narrative.
http://screencast.com/t/f2SCTaMG
See short video showing the difference. No narrative.
http://screencast.com/t/f2SCTaMG
you have two popup forms, "PopupTagMultiSelectitemsw ithFilter" and "PopupTagMultiSelectitems"
the changes in this uploaded db is NOW done only for "PopupTagMultiSelectitems"
RebuttalMaster--2A.accdb
the changes in this uploaded db is NOW done only for "PopupTagMultiSelectitems"
RebuttalMaster--2A.accdb
ASKER
I see one new line I did not see in the previous version.
Private Sub Form_Load()
If Me.OpenArgs & "" <> "" Then
Me.cboFilterGroup = Me.OpenArgs
Me.Requery
End If
Me.getFilter = myArg
End Sub
Its working great now.
Thanks
Private Sub Form_Load()
If Me.OpenArgs & "" <> "" Then
Me.cboFilterGroup = Me.OpenArgs
Me.Requery
End If
Me.getFilter = myArg
End Sub
Its working great now.
Thanks
this line
Me.getFilter = myArg
is already there, don't know where you use it for.
Me.getFilter = myArg
is already there, don't know where you use it for.
after setting the value of the combo to myarg, call the afterupdate event of the combo box