[AccessD] Leave Subform

Mark A Matte markamatte at hotmail.com
Mon Sep 24 12:54:24 CDT 2007


I did thanks...

I had to use a number of approaches including setting a variable ON EXIT that was evaluated in the BEFORE UPDATE to determine if the user was moving from record to record...or leaving the subform..

To track down exactly where I need each piece of code:  I had a subform(continuous) on an unbound form.  I also had a text box and a second subform(more controls but these are enough for the example).  I had code in the subform (ON CURRENT and BEFORE UPDATE).  I aslo had stuff on the subform(ON ENTER and ON EXIT).  In each of these areas I placed a MSGBOX with the name of the area...so I could see in exactly what order everything fired.  In the ONCURRENT I requeried the 2nd subform.  

To my amazement I learned that the BEFORE UPDATE was firing upto 3 times depending on how I was navigating.

I finally figured out what I needed...thanks Everyone.

It was definetely an education exercise.

Mark A. Matte
----------------------------------------> From: jwcolby at colbyconsulting.com> To: accessd at databaseadvisors.com> Date: Mon, 24 Sep 2007 13:05:54 -0400> Subject: Re: [AccessD] Leave Subform>> Did you ever get this handled?>>> 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>> --> AccessD mailing list> AccessD at databaseadvisors.com> http://databaseadvisors.com/mailman/listinfo/accessd> Website: http://www.databaseadvisors.com

_________________________________________________________________
Kick back and relax with hot games and cool activities at the Messenger Café.
http://www.cafemessenger.com?ocid=TXT_TAGLM_SeptWLtagline



More information about the AccessD mailing list