[Access/VBA] How to convert a RunMacro with a "repeat expression" in a simple function call ? (no more macro !)
3 réponses
loran750-google
Hello
i have that code : DoCmd.RunMacro "Boucle liste user 0", ,
"[Forms]![Form liste utilisateur]![Nom] Is Not Null"
I have converted the macro "Boucle liste user 0" to the function
""Boucle_liste_user_0".
How can i convert the RunMacro into a full VBA code ?
-> How can i write it ? I bet this is a loop code, but which loop code
: while expression1 ? Do ... while expression1 ? or else ?
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
loran750-google
hello
i tried that code but i'm getting into an infinite loop :( my code must be bad ! because before, while it was "full macro", it was working :(
Posté le: Ven Mar 10, 2006 12:51 Sujet du message:
--------------------------------------------------------------------------- ----- Do while (eval("[Forms]![Form liste utilisateur]![Nom] Is Not Null")) boucle_liste_user_0 loop --------------------------------------------------------------------------- -----
hello
i tried that code but i'm getting into an infinite loop :(
my code must be bad ! because before, while it was "full macro", it was
working :(
Posté le: Ven Mar 10, 2006 12:51 Sujet du message:
--------------------------------------------------------------------------- -----
Do while (eval("[Forms]![Form liste utilisateur]![Nom] Is Not Null"))
boucle_liste_user_0
loop
--------------------------------------------------------------------------- -----
i tried that code but i'm getting into an infinite loop :( my code must be bad ! because before, while it was "full macro", it was working :(
Posté le: Ven Mar 10, 2006 12:51 Sujet du message:
--------------------------------------------------------------------------- ----- Do while (eval("[Forms]![Form liste utilisateur]![Nom] Is Not Null")) boucle_liste_user_0 loop --------------------------------------------------------------------------- -----
Lyle Fairfield
What is the name of the procedure? Are you calling boucle_liste_user_0 recursively (does boucle_liste_user_0 call itself?) ? What happens to change [Forms]![Form liste utilisateur]![Nom] Is Not Null from Null to Not Null? Access Wizards create ill-conceived, clumsy, inefficient and just plain dumb code (and almost everything else). Perhaps, if you tell us what you are trying to do, someone will contribute suggestions for an efficient solution.
What is the name of the procedure? Are you calling boucle_liste_user_0
recursively (does boucle_liste_user_0 call itself?) ?
What happens to change [Forms]![Form liste utilisateur]![Nom] Is Not
Null from Null to Not Null?
Access Wizards create ill-conceived, clumsy, inefficient and just plain
dumb code (and almost everything else). Perhaps, if you tell us what
you are trying to do, someone will contribute suggestions for an
efficient solution.
What is the name of the procedure? Are you calling boucle_liste_user_0 recursively (does boucle_liste_user_0 call itself?) ? What happens to change [Forms]![Form liste utilisateur]![Nom] Is Not Null from Null to Not Null? Access Wizards create ill-conceived, clumsy, inefficient and just plain dumb code (and almost everything else). Perhaps, if you tell us what you are trying to do, someone will contribute suggestions for an efficient solution.
loran750-google
Hello Lyle Fairfield
Something was wrong inside boucle_liste_user_0 the exit condition ("Nom is not Null") couldn't be false. I corrected that.
Anyway, the problem is resolved, the code (do while ... loop) is correct, and it was what i was looking for.
Thank you !
ps : u are right. the wizards are so bad.
Hello Lyle Fairfield
Something was wrong inside boucle_liste_user_0
the exit condition ("Nom is not Null") couldn't be false. I corrected
that.
Anyway, the problem is resolved, the code (do while ... loop) is
correct, and it was what i was looking for.