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 / September 2005

Tip: Looking for answers? Try searching our database.

Macro maximums???

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bonnie - 16 Sep 2005 20:55 GMT
Hi there.  Using A02 on XP.  Tried to add a few sets of conditional SetValue
lines in my macro.  Had trouble, went to help, could have sworn I saw
something about macros can only have so many lines (255?) etc.  My macro has
LOTS of lines.  Do you get an error or does the macro just perform so many
lines and then just stop? Why should my first SetValue work and my second one
not?  If I switch their order, the first one works and the second one does
not.  No elipsis on lines.

Any ideas or suggestions?  Is there a place I can read up on this?  Couldn't
find it again in help.

Thanks in advance!
Signature

Bonnie

Ken Snell [MVP] - 16 Sep 2005 21:32 GMT
From the database window, type "Specifications" into the Help box. Press
Enter. You'll get the limits that you seek:

Attribute
Maximum
Number of actions in a macro                              999
Number of characters in a condition                     255
Number of characters in a comment                     255
Number of characters in an action argument         255

As for why the macro isn't working for the second step, you'll have to tell
us more about what the macro steps are and the arguments for each step.

Signature

       Ken Snell
<MS ACCESS MVP>

> Hi there.  Using A02 on XP.  Tried to add a few sets of conditional
> SetValue
[quoted text clipped - 12 lines]
>
> Thanks in advance!
Bonnie - 19 Sep 2005 17:20 GMT
Hi Ken.  Thanks for the info.  Regarding my macro, I don't think it has more
than 999 actions.  Most of it just verifies rules (if you select this, you
cannot also select that) and some of it uses the SetValues command.  The
problem part is this: I have a main form with a sub form for creating fee
bills.  On that sub form there are 3 sub sub forms that each check for items
that, if they have occured, require a charge.  One searches for records that
apply to the contract being billed in the amendment table, another the lost
participant search table and the third checks the participant statements
table.  If I am creating a fee bill for GP1289, my 3 sub sub forms are
showing, if any, records that apply to GP1289.  I have a text field on my sub
form that is 'reading' the record counts from the 3 sub sub forms and IIf
IsError = 0 otherwise show the record count from the sub sub form.  So, when
I click my Validate Button to run the macro, part of the macro is to SetValue
from those text boxes ([SubAmdmt], [SubSearch] and [SubStmt]) to my actual
form fields ([AmdmtNum], [SearchNum]  and [StmtNum]) and another SetValue to
multiply that new number in the form field and put the result in another
actual form field ([AmdmtNum] * 150; [SearchNum] * 10; and [StmtNum] * 1.25).
Problem is this, when I add this to my macro and run it, only one of the 3
sets is being updated.  If I change their order in my macro, whatever one is
first gets done.  Two lines of the macro work, that's it.  I've tried with
and without the elipsis and with and without conditions.  I've made a macro
for each sub sub form's SetValue commands and if I click each button, all 3
get updated.  Do I need some sort of pause command?  Can't figure it out.  I
have even created a separate macro and named each sub sub form's steps and in
my Validate macro, inserted the RunMacro command.  I've put them one after
the other as well as insert each of them throughout the macro body.  Still,
only the first one works.

Hope I gave you enough but not too much detail above.  Now I'm worried about
what other lines in my macros might be just pretending to work?  I don't get
any errors or messages when I run it.  Thanks for your help!
Signature

Bonnie

> From the database window, type "Specifications" into the Help box. Press
> Enter. You'll get the limits that you seek:
[quoted text clipped - 25 lines]
> >
> > Thanks in advance!
Ken Snell [MVP] - 19 Sep 2005 21:17 GMT
From your description, my first thought is that you're hitting against a
"timing" issue. Whenever you're reading from subforms, subsubforms, etc. and
wanting to use values within such a "nested" group, it's always possible
that the form hasn't finished updating when the macro is running its step.
This is very difficult to pin down in a macro, as you have very few options
for debugging there (much easier to do, though not *easy* to do, in VBA code
programming).

You might try changing to VBA code (where you can "pause" the code to give
it time to catch up) or to change your design/setup so that you get your
values in a way that is less dependent upon the timing being correct.

I wouldn't try to give you specific advice at this point because of the
form's complexity and interactions, none of which are known fully by me. But
you might try using textboxes on the main form that "read" the subform's and
subsubforms' values directly, similar to what you're doing on the subform?
Signature


       Ken Snell
<MS ACCESS MVP>

> Hi Ken.  Thanks for the info.  Regarding my macro, I don't think it has
> more
[quoted text clipped - 79 lines]
>> >
>> > Thanks in advance!
Bonnie - 20 Sep 2005 12:34 GMT
Thanks Ken.  Your words make sense.  Playing with it this morning I noticed
the slight flashing as I ran it and noticed if I ran the individual macro
steps to update the fields and then ran a button with the two macros,
whichever one was listed second reset to zeros.  Per your advice, I plan to
run an OnClick Event Procedure that runs each macro step.  Is there a
specific command I need to use to 'pause' or just run the updates as separate
macros in my code?  Could I add the Hourglass to my macro to pause it?  I'll
play some more.

Thank you again for being here to help folks out!

Signature

Bonnie

> From your description, my first thought is that you're hitting against a
> "timing" issue. Whenever you're reading from subforms, subsubforms, etc. and
[quoted text clipped - 95 lines]
> >> >
> >> > Thanks in advance!
Ken Snell [MVP] - 21 Sep 2005 01:37 GMT
I don't know enough about your setup to make a conclusion about the specific
"meaning" of the other textboxes being set to zero, so that may or may not
be a timing issue. But let's assume for the moment that it is.

Running the hourglass action does not pause the code; it just sets the
cursor to the hourglass. To "pause" code, we typically use a VBA
statement -- DoEvents -- which returns control of the "computer" to other
pending actions and then the code picks up again from where it left off. By
looping through a number of these statements, one can get varying, but
uncontrolled (you can't set it for a specific time period), pauses.

However, you cannot do this directly in a macro. But you can call it from a
macro.

Create a public function in a regular module (Modules in the database
window); create a new one, and paste this code into the window:

Public Function WasteSomeTime(Optional lngNumberOfTimes As Long = 1) As Long
Dim lngLoop As Long
For lngLoop = 1 To lngNumberOfTimes
   DoEvents
Next lngLoop
WasteSomeTime = lngNumberOfTimes
End Function

Save the module (name it basFunctions).

Then, in your macro, call the function using the RunCode action. The
function name that you type in as the argument would be
   WasteSomeTime(10)
if you want to loop 10 times, or
   WasteSomeTime()
if you just want to loop once.

Signature

       Ken Snell
<MS ACCESS MVP>

> Thanks Ken.  Your words make sense.  Playing with it this morning I
> noticed
[quoted text clipped - 140 lines]
>> >> >
>> >> > Thanks in advance!
Bonnie - 21 Sep 2005 15:18 GMT
Ken, you are da bomb!  Thank you VERY much for coming back with the
WasteSomeTime function.  It allows me to update all 3 subsubforms within the
validation macro.  Thanks bunches!!!
Signature

Bonnie

> I don't know enough about your setup to make a conclusion about the specific
> "meaning" of the other textboxes being set to zero, so that may or may not
[quoted text clipped - 174 lines]
> >> >> >
> >> >> > Thanks in advance!
Ken Snell [MVP] - 21 Sep 2005 16:21 GMT
You're welcome... good luck!

Signature

       Ken Snell
<MS ACCESS MVP>

> Ken, you are da bomb!  Thank you VERY much for coming back with the
> WasteSomeTime function.  It allows me to update all 3 subsubforms within
[quoted text clipped - 217 lines]
>> >> >> >
>> >> >> > Thanks in advance!
 
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.