Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ARGH! Event timing ? Forms & Subforms

Status
Not open for further replies.

BobJacksonNCI

Technical User
Mar 11, 2003
725
US
I'm trying to provide my users with the ability to cancel a form that has a subform and am having a problem.

(I'm trying to give the user the capability to cancel a form/subform so I do not have to give them delete capability - after records have been saved.)

Environment is Access 2000 FE / SQL 7 BE

The subform controls have validation routines that execute during BeforeUpdate. Tied to the Form's Cancel button is:

If Forms!frm_TIME_OFF!frm_TIME_OFF_SUBFORM.Form.Dirty Then
Forms!frm_TIME_OFF!frm_TIME_OFF_SUBFORM.Form.Undo
End If

When I select the Cancel button, the Subform BeforeUpdate events are triggered and I'm prompted to correct invalid or enter missing subform data.

Can anyone help?
Bob
 
Hi Bob have you tried to place your code in (Beforeupdate)
a check is made there before anything is written in the table.
I call a function and if the answer is wrong I cancel the formular in Beforupdate with
if +++ then
Me.Form.Undo
exit sub
end if

Merry Christmas and Happy New Year

Mark
 
Mark,

Thanks for your reply!

Yeah, I've experimented with SEVERAL event combinations.
What I've ended up with is when the form is closed, if there's no subform record for the form record, I run a pass through query to delete the form (orphan) record.

I'm thinking this is a non-standard Access issue - related to Access project and possibly using Access 2000 / SQL 7 as opposed to Access XP / SQL 2000...

Pleasant Holidays to you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top