Access - Function
Solved
CLABEN
Posted messages
23
Status
Membre
-
Samygale Posted messages 46 Status Membre -
Samygale Posted messages 46 Status Membre -
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 réponses
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
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
- ok for the cursor position
- from a button placed on the form, I activate a macro to
a) Open Form
b) ExecuteCode ... Function name: F_Filtrer()
The most surprising thing is that the command worked 3 or 4 times!!!