Stop AfterUpdate macro from running

S

slymeat

When I insert a new record in a subform and then move off the sub-form, the
AfterInsert and AfterUpdate events/macros are both running, one after the
other.

Is there anyway of preventing the Afterupdate event/macro from running as
well as the AfterInsert method (when I insert a new record). I have separate
pieces of code that run on for each event but the code that runs on the
AfterUpdate event causes an error if it runs after the code that runs for the
AfterInsert event. (Hope this makes sense!)

I need the code to be also present in the Afterupdate event to cover that
occurance.

Any help would be greatly appreciated
 
J

Joseph R. Pottschmidt

Dear Slymeat:

What does the two events do for the afterUpdate event and the
AfterInsert Invent.

If you need to move between the main form and the sub-form, what is the
reason and why?

In regards to the events being fired, they automatically fire in a
specified order.

If you look under help file in MS Access there is a help document that
is named "Order of Events for Database Objects". Take a look at that and
this will give you all the information about order of events and how
they are fired based on what is going on between forms, and sub-forms
and any other kinds of focus and moving focus to another object or
control.

Joe P.



-----Original Message-----
From: slymeat [mailto:[email protected].(donotspam)]
Posted At: Friday, June 23, 2006 2:58 AM
Posted To: microsoft.public.access.macros
Conversation: Stop AfterUpdate macro from running
Subject: Stop AfterUpdate macro from running

When I insert a new record in a subform and then move off the sub-form,
the
AfterInsert and AfterUpdate events/macros are both running, one after
the
other.

Is there anyway of preventing the Afterupdate event/macro from running
as
well as the AfterInsert method (when I insert a new record). I have
separate
pieces of code that run on for each event but the code that runs on the
AfterUpdate event causes an error if it runs after the code that runs
for the
AfterInsert event. (Hope this makes sense!)

I need the code to be also present in the Afterupdate event to cover
that
occurance.

Any help would be greatly appreciated
 
S

Steve Schapel

Andrew,

The After Insert and After Update events both happen when you add a new
record. There is no way for this to not happen. If you can give some
more specific details about what you want to happen, someone may be able
to suggest an alternative approach.
 

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