PC Review


Reply
Thread Tools Rate Thread

[Access/VBA] How to convert a RunMacro with a "repeat expression" in a simple function call ? (no more macro !)

 
 
loran750-google@yahoo.fr
Guest
Posts: n/a
 
      10th Mar 2006
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 ?

Thank you & Merci ŕ tous !

 
Reply With Quote
 
 
 
 
loran750-google@yahoo.fr
Guest
Posts: n/a
 
      10th Mar 2006
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
--------------------------------------------------------------------------------

 
Reply With Quote
 
Lyle Fairfield
Guest
Posts: n/a
 
      10th Mar 2006
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.

 
Reply With Quote
 
loran750-google@yahoo.fr
Guest
Posts: n/a
 
      10th Mar 2006
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple Macro to "Lookup -> Repeat" James8309 Microsoft Excel Programming 3 21st Nov 2008 07:26 AM
RunMacro - Repeat Expression =?Utf-8?B?bmlja25hbWVDbGFpcg==?= Microsoft Access 0 20th Feb 2007 04:29 PM
Simple "IF" Expression in Access Report Nick Microsoft Access Reports 7 13th Jun 2006 05:01 PM
Can "expression is" call a VB function? =?Utf-8?B?TWF1cnkgTWFya293aXR6?= Microsoft Access 3 8th Oct 2004 12:13 AM
Re: Macro Error: & "Function is not available in expression in criteria expression" Douglas J. Steele Microsoft Access 1 4th Aug 2003 10:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:41 PM.