[AccessD] Leave Subform

jwcolby jwcolby at colbyconsulting.com
Fri Sep 21 10:31:36 CDT 2007


Mark,

If it were me I would just code in the subform to store the PKID of the
current record in OnCurrent.  Then in OnExit, reach back in to the subform
and retrieve the PKID saved there.  Now you know what record the subform was
on.  Run an SQL statement from the OnCurrent updating the flag field back to
0 (or whatever) in that table for that PKID.  That should take just a couple
of minutes to get working.

John W. Colby
Colby Consulting
www.ColbyConsulting.com 
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Mark A Matte
Sent: Friday, September 21, 2007 11:08 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Leave Subform


Thanks A.D.,

But with using the code below...the Before update still fires.

Any Ideas?

Thanks,

mark

----------------------------------------> From: adtp at airtelbroadband.in> To:
accessd at databaseadvisors.com> Date: Fri, 21 Sep 2007 11:03:33 +0530> CC:
adtejpal at gmail.com> Subject: Re: [AccessD] Leave Subform>> Mark,>> This has
to do with two complementary features:>> (a) Prior to final exit from
subform control, current record in the subform gets saved (if the subform is
still dirty) and the subform attains non-dirty state.> (b) Exit from subform
control can not take final effect so long as the subform is dirty.>> Sample
code as given below, should take care of the problem faced by you. SF_Sub is
the name of subform control, while Price is the name of field in the
subform, whose value in current record gets set to 100 whenever exiting the
subform control.>> Best wishes,> A.D.Tejpal> ----------->> Exit event of
subform control on the main form> ===================================>
Private Sub SF_Sub_Exit(Cancel As Integer)> Me.SF_Sub("Price") = 100>
Me.SF_Sub.Form.Dirty = Fals!
 e> End Sub> ===================================>> ----- Original Message
-----> From: Mark A Matte> To: accessd at databaseadvisors.com> Sent: Friday,
September 21, 2007 00:51> Subject: [AccessD] Leave Subform>>> Hello All,>>
Have an A97 db...I have a subform/continuous...when I leave/exit that>
subform I want to change a value on the current record of the subform. I>
thought I could do this by using the "On Exit" property of the subform. The>
problem is when I click out of the subform...the "on Exit" does fire...but>
if I put code in that references the field I want to change...the click
part> is cancelled and the subform maintains focus.>> Any suggestions?>>
Thanks,>> Mark>> P.S...I can't use the "Before Update" of the subform
itself...because going> to a new record in the form does something
different.> --> AccessD mailing list> AccessD at databaseadvisors.com>
http://databaseadvisors.com/mailman/listinfo/accessd> Website:
http://www.databaseadvisors.com

_________________________________________________________________
Capture your memories in an online journal!
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list