Access - Function
Solved
CLABEN
Posted messages
23
Status
Member
-
Samygale Posted messages 46 Status Member -
Samygale Posted messages 46 Status Member -
Hello,
Windows XP – Access 2000.
I created a function to filter records. When I activate the function, I get the following message: "the entered expression contains an unrecognized function name." When I open the function to edit it, I notice that the setting in the top right is "(Declarations)" and the name is "F_Filtrer" (that's the name given to the function). If I select "F_Filtrer" and save it, as soon as I use it, the setting deactivates and reverts back to "(Declarations)." It’s worth noting that the function worked correctly 2 or 3 times. I don’t understand.
Thank you for your responses
Windows XP – Access 2000.
I created a function to filter records. When I activate the function, I get the following message: "the entered expression contains an unrecognized function name." When I open the function to edit it, I notice that the setting in the top right is "(Declarations)" and the name is "F_Filtrer" (that's the name given to the function). If I select "F_Filtrer" and save it, as soon as I use it, the setting deactivates and reverts back to "(Declarations)." It’s worth noting that the function worked correctly 2 or 3 times. I don’t understand.
Thank you for your responses
Configuration: Windows XP Access 2000
5 answers
-
Hello,
The lists you're talking about simply indicate which section of code your cursor is in ("Declarations" when the cursor is at the beginning of the module...).
Is this F_Filtrer function called by a button? -
D'accord, je comprends que tu souhaites voir le code, mais je ne peux pas fournir cela.
-
Here is the code:
Function F_Filtrer()
Filtre1 = "[Lettre] Like ""*"" & forms![F_Fiche_Selection].[CXPROP] & ""*"""
Filtre2 = "[Entreprise] Like ""*"" & forms![F_Fiche_Selection].[CXENTMAT] & ""*"""
Filtre3 = "[Designation] Like ""*"" & forms![F_Fiche_Selection].[CXDES] & ""*"""
DoCmd.OpenForm "F_Fiche_Selection_Resultat", acNormal, "", Filtre1 & " And " & Filtre2 & " And " & Filtre3, , acNormal
End Function
-
-
Oki, we can start with the syntax:
Filter1 = "[Letter] Like ""*"" & forms![F_Fiche_Selection].[CXPROP] & ""*"""
Filter1 = "[Letter] Like '*" & forms![F_Fiche_Selection].[CXPROP] & "*'"
==> [Letter] Like '*VALUE*'
Which line gives you an error? -
Re,
Ok, are there any filter data in your records for characters ' or " by any chance? -