PC Review


Reply
Thread Tools Rate Thread

Conditional Loop in Macro

 
 
Jeff H
Guest
Posts: n/a
 
      25th Jun 2009

I need to be to loop a series of queries in macro until a condition is met. I
can't quite figure out how to do it.

For each job activity the client has had, he/she has a possibility of having:
Placement Milestone
1-Month Milestone
3-Month Milestone
6-Month Milestone
9-Month Milestone

Some initial milestones for clients are missing. For example, a client may
have a 6-month milestone for an activity but be missing the placement,
1-month and 3-month milestones.

I have the correct queries created. I just need help creating the
conditional loop in the macro I need to run periodically to catch any new
records meeting the criteria.

Logic:

Marker1
Query1: Make table of "faux" milestones to append.
If Record_Count("faux" table) = 0 GoTo EndMacro
Append "faux" records to milestone table
GoTo Marker1
EndMacro

Any help would be appreciated. If there is a more efficient way than a
macro, let me know.
 
Reply With Quote
 
 
 
 
Steve Schapel
Guest
Posts: n/a
 
      25th Jun 2009

Jeff,

Assuming I understand you correctly (which is not guaranteed because I do
not completely follw everything you wrote), you can make a second macro,
using a RunMacro action, to run the existing macro. And in the Repeat
Expression argument, it looks like you need this:
DCount("*","faux")>0

--
Steve Schapel, Microsoft Access MVP


"Jeff H" <(E-Mail Removed)> wrote in message
news:84B57B76-8FF4-439A-8C69-(E-Mail Removed)...
> I need to be to loop a series of queries in macro until a condition is
> met. I
> can't quite figure out how to do it.
>
> For each job activity the client has had, he/she has a possibility of
> having:
> Placement Milestone
> 1-Month Milestone
> 3-Month Milestone
> 6-Month Milestone
> 9-Month Milestone
>
> Some initial milestones for clients are missing. For example, a client may
> have a 6-month milestone for an activity but be missing the placement,
> 1-month and 3-month milestones.
>
> I have the correct queries created. I just need help creating the
> conditional loop in the macro I need to run periodically to catch any new
> records meeting the criteria.
>
> Logic:
>
> Marker1
> Query1: Make table of "faux" milestones to append.
> If Record_Count("faux" table) = 0 GoTo EndMacro
> Append "faux" records to milestone table
> GoTo Marker1
> EndMacro
>
> Any help would be appreciated. If there is a more efficient way than a
> macro, let me know.
>




__________ Information from ESET Smart Security, version of virus signature database 4189 (20090625) __________

The message was checked by ESET Smart Security.

http://www.eset.com



 
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
Conditional BackColor Loop obsessive Microsoft Excel Programming 6 1st May 2006 01:59 AM
conditional argument for FOR loop? Matt Williamson Microsoft Windows 2000 CMD Promt 3 17th Nov 2005 02:36 AM
Conditional Formatting in a Loop =?Utf-8?B?bG9zdCEh?= Microsoft Excel Programming 8 6th Oct 2004 02:43 PM
conditional formatting & a loop =?Utf-8?B?bG9zdCEh?= Microsoft Excel Programming 1 27th Sep 2004 08:59 PM
Conditional alternating loop W.J.Surrarrer Microsoft Excel Programming 0 3rd Jun 2004 01:29 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:57 PM.