Link to home
Start Free TrialLog in
Avatar of Jillyn_D
Jillyn_DFlag for United States of America

asked on

Before update Cancel = True

If you set Cancel to True in the Before Update event of a new record, will it delete the record?

Thanks!
SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jillyn_D

ASKER

Darn!  Even if the NewRecord still returns true?
Anyone have a nifty idea for deleting the new record if the requirements in the on-update event are not met?

I'm headed out now, but will check this early AM on Monday.  And I'll assign more points.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I'll give that a shot come Monday.  Thanks, rocki!

~Jillyn
>Anyone have a nifty idea for deleting the new record if the requirements in the on-update event are not met?
A better idea would be to put those 'requirements' into the BeforeInsert event.
That way if the 'requirements' do not validate, the record is not inserted in the first place.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Jeff - that's two words - unbound form ;-)
Ray...one word....duh!!

:o)

Just for edification....we really only use unbound forms for straight data entry. Most cases where we allow edits, we change the allowadditions property to no.
Forms with subforms however...different animals. But I just didn't want everyone to think I was gimmped up on Unbounds.
J
I love em personally - just aren't blinded by them.  A tool for every situation.  A scalpel not a crowbar :-)
I've nothing against those are *are* gimmped up on them though.
jimhorn,

> A better idea would be to put those 'requirements' into the BeforeInsert event.
> That way if the 'requirements' do not validate, the record is not
> inserted in the first place.

That was my thought too!  Unfortunately, the before update event happens as soon as you try to leave a field in the record, so it was kicking off before enough information could be input to check against the requirements :(

~Jillyn
jefftwilley,

> Un Bound Form
That would be really nice.  Unfortunately, this form does so many things there's not a good way for me to have it unbound without redesigning this application. :(

~Jillyn
"the before update event happens as soon as you try to leave a field in the record"

If it's form level validation that you crave - then performing the validation on the Form's before Update event would be most normal.
Sorry for the delay in getting back to this!

Thanks for all the ideas!

I'm in the process of testing out Rocki's Undo idea right now.

More info:  This particular form starts out as an unbound form, and its recordsource is set depending on how the user accesses it and what their rights are.  It has four sub-forms (all read-only), and can be viewed in single form view or datasheet view.  Users are allowed unrestricted add and edit rights until a drawing is released.  Deletions are never allowed.
Hi LPurvis,

I'm looking for record-level validation in cases where a record's parent drawing has been released.

~Jillyn
Hi again.

Re: http:#a18160484
"starts out as an unbound form"
Do you perhaps mean "a bound form - without a recordsource yet to be set" ? ;-)

It's true - switching to a continuous form view (i.e. datasheet) would pretty much preclude it being unbound.
(I personally don't have forms that operate in either view, not anymore anyway ;-).  I always have separate forms - each set to behave properly in a given mode).
That's probably the only thing that obviously prevents it.

Re: http:#a18160494
"I'm looking for record-level validation"
Yeah indeed - record level.  Before Update is entirely suited to that.
> Do you perhaps mean "a bound form - without a recordsource yet to be set" ? ;-)
Yes...*sheepish*
Undo works :)

Thanks everyone!