code that can exit from subform and save record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

dear sir ,
i would like to know the code that can exit from the sub form on exit its
lost field
and return to main form tab 0 field and save the records
how to do this please
at present the curser is plying on my sub form only.there is a need of lot
of key stokes/curser actions to save and return to the main form first field
how to do this please
 
you don't need to explicitly save a subform record when you exit back to the
mainform, it saves automatically. if you're only adding one subform record
before going back to the mainform, you can add code to the last control in
the subform's TabOrder to set focus on the mainform record again. something
along the lines of

Me.Parent!NameOfFirstControlInMainForm.SetFocus

if you may add multiple subform records to one mainform record at a time,
the above won't work well, of course. in that case, you can underline a
letter in the caption of the label attached to the first control on the
mainform (the same way you underline a letter in the caption of a command
button, using the ampersand), and use that to move to the mainform control
from within the subform.

hth
 
Back
Top