Macro not repeating

  • Thread starter JessicaMorris via AccessMonster.com
  • Start date

J

JessicaMorris via AccessMonster.com

I'm trying to make a macro repeat. What I actually want is to use the
'repeat expression' field, but nothing I do seems to make it run >ONCE.
Thinking I might not be stating the expression correctly, I tried to just use
'repeat count', but it still runs only once. It's a very simple 'transaction
processing' macro:

open form
go to first record
run macro (repeating)

macro (repeating):
set values
next record

Can anyone help?

Thanks,
JMM
 
Ad

Advertisements

G

Guest

You need macro (repeating): to call itself with a condition. The condition
is so it will not try to repeat forever.

NOTE - A macro can only call itself either 20 or 21 times.
 
J

JessicaMorris via AccessMonster.com

Do you mean the 'repeat expression' and 'repeat count' don't work on the 'run
macro (repeating)' line? that I mus also have run macro from WITHIN the
actual macro I want to repeat? thusly:

processing' macro:
open form
go to first record
run macro (repeating)

macro (repeating):
set values
next record
run macro (repeating) with repeat expression on this line?

I can see how that could work, but it seems an odd way to do it...and what's
the point of those two parameters on the first line if they don't do anything?
All the documentation points to this, but it doesn't work. I'll try it and
let you know.

Also, I don't understand the 20-21 comment...are you saying no matter what I
put in these two parameters, it will only run 20-21 times?
 
G

Guest

Forget what I posted before as I had never used a repeating macro.
After reading some I see the 'repeat expression' is not what will cause it
to keep going but what will make it stop. You might use a test for EOF.
 
J

JessicaMorris via AccessMonster.com

My problem isn't that it isn't stopping, it's that it isn't REPEATING. It
runs ONCE, no matter what I put into either expression.

Thanks,
JMM

KARL said:
Forget what I posted before as I had never used a repeating macro.
After reading some I see the 'repeat expression' is not what will cause it
to keep going but what will make it stop. You might use a test for EOF.
Do you mean the 'repeat expression' and 'repeat count' don't work on the 'run
macro (repeating)' line? that I mus also have run macro from WITHIN the
[quoted text clipped - 37 lines]
 
S

Steve Schapel

Jessica,

You did not say what you put in the Repeat Expression argument of the
macro. In fact, it might help if you could tell us this: "I want the
macro to keep repeating until..." just in plain English. Karl has tried
to answer your question, but you didn't give us much to go on.
 
Ad

Advertisements

J

JessicaMorris via AccessMonster.com

what I actually want it to do is transaction processing in a query: deduct
amount due from a payment until the balance =0 or all transactions are paid.
however, I started just trying to get it to repeat 16 times (the number of
transactions I was testing) and even that didn't work. The macro works
perfectly ONCE and stops. So it looks like neither condition is working.

Odd coincidence to hear from you today...I just had an inspiration...I
created a new DB, created the repeating macro, and ran it from a separate
macro, and BOTH conditions work perfectly, just as the documentation says!

In my application, I have them both as named macros within the same macro....
doesn't seem that would matter. This is so simple! I can't believe I'm
having problems, but I never thought about being in the same macro being a
problem. It runs fine the first time. I can't think of a reason it would
matter, but I can handle it!

I don't have time to get into my application right now...I have an
appointment, but I'll try it later, and get back to you.

Thanks for following up. This forum is my main resource...I only got that
one response and it didn't go anywhere...I had given up.

JMM
My problem isn't that it isn't stopping, it's that it isn't REPEATING. It
runs ONCE, no matter what I put into either expression.

Thanks,
JMM
Forget what I posted before as I had never used a repeating macro.
After reading some I see the 'repeat expression' is not what will cause it
[quoted text clipped - 4 lines]
 
Ad

Advertisements

J

JessicaMorris via AccessMonster.com

Sorry to be so long responding. I found a way around this, although I still
don't understand why it didn't work.

I had both the initial macro and the one I wanted to repeat as named macros
in the same macro. The 'repeat' ran ONCE, no matter what was in either of
the repeat parameters. When I moved the repeat to a separate standalone
macro, it works.

Thanks,
JMM
what I actually want it to do is transaction processing in a query: deduct
amount due from a payment until the balance =0 or all transactions are paid.
however, I started just trying to get it to repeat 16 times (the number of
transactions I was testing) and even that didn't work. The macro works
perfectly ONCE and stops. So it looks like neither condition is working.

Odd coincidence to hear from you today...I just had an inspiration...I
created a new DB, created the repeating macro, and ran it from a separate
macro, and BOTH conditions work perfectly, just as the documentation says!

In my application, I have them both as named macros within the same macro....
doesn't seem that would matter. This is so simple! I can't believe I'm
having problems, but I never thought about being in the same macro being a
problem. It runs fine the first time. I can't think of a reason it would
matter, but I can handle it!

I don't have time to get into my application right now...I have an
appointment, but I'll try it later, and get back to you.

Thanks for following up. This forum is my main resource...I only got that
one response and it didn't go anywhere...I had given up.

JMM
My problem isn't that it isn't stopping, it's that it isn't REPEATING. It
runs ONCE, no matter what I put into either expression.
[quoted text clipped - 7 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top