Before update

Bee

Registered User.
Local time
Today, 10:43
Joined
Aug 1, 2006
Messages
486
Hi,

I read on the Access help about the 'Before Update' property; however, I still don't understand what it does.

Any help will be very much appreciated.
B
 
B,

The BeforeUpdate event fires after the Control is changed, but BEFORE the
underlying table is actually modified. It allows you to set Cancel=True to
prevent the table from being updated if desired.

The AfterUpdate event fires after the table is updated. It has no provisions
to Cancel the action.

At least as far as I know ...

hth,
Wayne
 
WayneRyan said:
B,

The BeforeUpdate event fires after the Control is changed, but BEFORE the
underlying table is actually modified. It allows you to set Cancel=True to
prevent the table from being updated if desired.

The AfterUpdate event fires after the table is updated. It has no provisions
to Cancel the action.

At least as far as I know ...

hth,
Wayne
W,

How do you trigger it though? Because I tried it, but nothing seemed to happen.

Regards,
B
 
The BeforeUpdate event of a control occurs before changed data in a control or record is updated.


The BeforeUpdate event for a form will happen just before the changes to the record are written to the table.
 
How do you trigger it though

By putting code in it.
If it's not triggered then the code conditions are not met.
If you expect the code to be triggered and it isn't, well, then your code is incorrect ;)

RV
 
It happens whether you have coded for it or not. Trapping for it give you the advantage of what to do if the user has not met your criteria before allowing the current record to be saved to the table.

Only a dirty record will trigger the before "forms" update event. As mentioned above, it happens just before the record is saved to the table. Search around for there are plenty of examples on how to trap for it.

Look for my "better mouse trap" thread for a good sample.
 

Users who are viewing this thread

Back
Top Bottom