J
Jac Tremblay
Hi,
I have a beneficiary form with a Search button on it. When the user clicks
on it, a Search form appears where one can specify a code or a
LastName/FirstName pair (either one or both can be empty).
From those entries, I build a filter which I want to apply to the
beneficiary form.
This part works fine thanks to the many instructive posts I found on this
newsgroup.
The part that does not work is the second ApplyFilter (I first clear the
filter and then try to apply the new one).
Here is some parts of the code I use:
' **********************************
' Remove the old filter (works fine).
strFiltreNul = "(NO_DOSS_IR = ""*"")"
DoCmd.ApplyFilter FilterName:=strFiltreNul
' Apply the new filter (doesn't work).
Form_frmBénéfDeGauche.SetFocus
Form_frmBénéfDeGauche.NO_DOSS_IR.SetFocus
DoCmd.ApplyFilter FilterName:=strFiltre
Form_frmBénéfDeGauche.FilterOn = True
' **********************************
Note: Object and variable names are in French.
Because this part doesn't work, I wrote this code to circumvent the problem
in the mean time. It's a macramé and inefficient way to do things but at
least, I can go on with the development.
' **********************************
' Close the form and reopen it with the filter.
DoCmd.Close acForm, strNomFormulaire, acSaveYes
DoCmd.OpenForm FormName:=strNomFormulaire, View:=acNormal, _
WhereCondition:=strFiltre
' **********************************
Note: strNomFormulaire = Form_frmBénéfDeGauche
Anyone has some idea of what is wrong in my application?
Thanks in advance.
I have a beneficiary form with a Search button on it. When the user clicks
on it, a Search form appears where one can specify a code or a
LastName/FirstName pair (either one or both can be empty).
From those entries, I build a filter which I want to apply to the
beneficiary form.
This part works fine thanks to the many instructive posts I found on this
newsgroup.
The part that does not work is the second ApplyFilter (I first clear the
filter and then try to apply the new one).
Here is some parts of the code I use:
' **********************************
' Remove the old filter (works fine).
strFiltreNul = "(NO_DOSS_IR = ""*"")"
DoCmd.ApplyFilter FilterName:=strFiltreNul
' Apply the new filter (doesn't work).
Form_frmBénéfDeGauche.SetFocus
Form_frmBénéfDeGauche.NO_DOSS_IR.SetFocus
DoCmd.ApplyFilter FilterName:=strFiltre
Form_frmBénéfDeGauche.FilterOn = True
' **********************************
Note: Object and variable names are in French.
Because this part doesn't work, I wrote this code to circumvent the problem
in the mean time. It's a macramé and inefficient way to do things but at
least, I can go on with the development.
' **********************************
' Close the form and reopen it with the filter.
DoCmd.Close acForm, strNomFormulaire, acSaveYes
DoCmd.OpenForm FormName:=strNomFormulaire, View:=acNormal, _
WhereCondition:=strFiltre
' **********************************
Note: strNomFormulaire = Form_frmBénéfDeGauche
Anyone has some idea of what is wrong in my application?
Thanks in advance.