Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Macros / July 2004

Tip: Looking for answers? Try searching our database.

Looping Macros

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dunner - 29 Jul 2004 10:23 GMT
Hey guys,

I'm trying to setup a macro that will call a mail merge
document and then assign the time to a field on a bunch
of records. I have the first part done but I'm having
difficulty getting it to stamp all the records in a
specific form (the form having pulled out the records
that will need stamping).

Is it possible to loop the macro so that it runs from the
first to the last record in the form, stamping each one?
Also is it true that using the RunMacro command I can
only run it 20 times? This would cause major problems as
I envisage my database growing beyond 20 records in the
very near future, is there a better command I should use?

Thanks Guys

Dunner
Steve Schapel - 29 Jul 2004 21:48 GMT
Dunner,

This sounds like a job for an Update Query, which you can set up to
update the vlaue of your field to Time() and if you want to include
running this query into your macro, use the OpenQuery action.

I have heard before in this newsgroup of someone who came upon some sort
of 20 repetition limitation on the RunMacro action, but I have never
encountered it myself, and all my tests allow large numbers of
repetitions.  But anyway, in your specific case, it seems to not be
relevant.

Signature

Steve Schapel, Microsoft Access MVP

> Hey guys,
>
[quoted text clipped - 15 lines]
>
> Dunner
Dunner - 30 Jul 2004 09:22 GMT
Hi Steve,

Thanks for the help, I'll have to look into creating an
update query to do the job. As for the 20 repitition
issue, that came up in a test macro I created. I think it
limits the number of times a macro can call itself. I had
moved on since and split it into two macros one calling
the other which doesn't seem to have any limits. Nice
little tit-bit of information to know though!

Thanks for your help

Dunner

>-----Original Message-----
>Dunner,
[quoted text clipped - 29 lines]
>> Dunner
>.
Ken Snell - 31 Jul 2004 02:02 GMT
Ah, calling the macro from itself would likely have this limitation because
of stacking limits.

However, using RepeatMacro action in a macro avoids that limitation because
it loops the macro instead of calling itself as a new macro.

Signature

       Ken Snell
<MS ACCESS MVP>

> Hi Steve,
>
[quoted text clipped - 57 lines]
> >> Dunner
> >.
M.L. Sco Scofield - 31 Jul 2004 05:22 GMT
Uncle Ken,

RepeatMacro???

I can't remember ever seeing this one. I just checked Access 97 and 2003.
(Only versions on this machine.) I can't find anything.

You sure???

Sco

> Ah, calling the macro from itself would likely have this limitation because
> of stacking limits.
[quoted text clipped - 63 lines]
> > >> Dunner
> > >.
Ken Snell - 31 Jul 2004 18:29 GMT
Ack... memory is the first thing to go when you get old.

My reference meant to be to the Repeat Count or Repeat Expression part of
the RunMacro.

My understanding of the OP's note is that he was just calling his macro over
and over, without using the Repeat arguments. Thanks for the "memory jolt"!

Signature

       Ken Snell
<MS ACCESS MVP>

> Uncle Ken,
>
[quoted text clipped - 76 lines]
> > > >> Dunner
> > > >.
M.L. Sco Scofield - 31 Jul 2004 20:28 GMT
Interesting.

The only time I do macros is in class to teach them.

I've never used RunMacro so I never noticed the Repeat args.

It's just sooo much easier to make a Do-Loop. :-)

Sco

> Ack... memory is the first thing to go when you get old.
>
[quoted text clipped - 84 lines]
> > > > >> Dunner
> > > > >.
Ken Snell - 31 Jul 2004 23:00 GMT
> Interesting.
>
> The only time I do macros is in class to teach them.
>
> I've never used RunMacro so I never noticed the Repeat args.

Old saying...them that can't do, teach?

< g , d, & rrrrrrrrrrrrr >

Signature

       Ken Snell
<MS ACCESS MVP

Ken Snell - 31 Jul 2004 23:11 GMT
And now in the interest of full disclosure....

I teach too!

Signature

       Ken Snell
<MS ACCESS MVP>

> > Interesting.
> >
[quoted text clipped - 5 lines]
>
> < g , d, & rrrrrrrrrrrrr >
M.L. Sco Scofield - 01 Aug 2004 00:00 GMT
LOL! :-)

Sco

> And now in the interest of full disclosure....
>
[quoted text clipped - 9 lines]
> >
> > < g , d, & rrrrrrrrrrrrr >
M.L. Sco Scofield - 01 Aug 2004 00:00 GMT
Ken,

How do you spell pssst???

Sco

> > Interesting.
> >
[quoted text clipped - 5 lines]
>
> < g , d, & rrrrrrrrrrrrr >
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.