[AccessD] Leave Subform

A.D.TEJPAL adtp at airtelbroadband.in
Fri Sep 21 00:33:33 CDT 2007


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 = False
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.


More information about the AccessD mailing list