Re: Subform - Add New Record

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: John Vinson (jvinson_at_STOP_SPAM.WysardOfInfo.com)
Date: 10/06/04


Date: Tue, 05 Oct 2004 19:37:55 -0600

On Tue, 05 Oct 2004 22:45:28 GMT, "Peter Smith"
<psmith6@SparnBlock.bigpond.net.au> wrote:

>
>"John Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> wrote...
>> Private Sub cmdGoToNew_Click()
>> Me.subMySubform.SetFocus
>> DoCmd.GoToRecord acNewRecord
>> End Sub
>
>Excellent. I had to change that to acNewRec (must be for A97) but it works
>great - thanks so much. One other thing-
>
>When I was using a pop-up form for dataentry, I could use the OnClose event
>to check for saving ('if Dirty' before going back to switchboard). How is
>it best to do this on a subform as it doesn't close when you move off it to
>a different tab?
>
>- Peter
>

You can use the BeforeUpdate event of the Subform control. It only
fires if a record on the subform is dirtied and subsequently you try
to save it (say by moving off the subform).

                  John W. Vinson[MVP]
             Join the online Access Chats
        Tuesday 11am EDT - Thursday 3:30pm EDT
      http://community.compuserve.com/msdevapps



Relevant Pages

  • Re: combo box that updates outside table and then needs to be requeried
    ... In the OnClose event of your data entry form, ... > I have a main form with about 6 tabs. ... On the subform, which is used to populate a table, is a combo ...
    (microsoft.public.access.forms)
  • Re: Subform problem
    ... >that opens another form called [frm private companies]. ... the OnClose event of the smaller form is ... >contains the client name. ... >smaller form as a subform of the main form, with a button on the main form ...
    (microsoft.public.access.forms)
  • Re: Logout idle users and discard changes
    ... I would just use the Main Form's OnClose event. ... to how to test the dirty property of a subform in a generic fashion. ... Debra ...
    (comp.databases.ms-access)
  • Re: Issue with the Lebans "Justify" module
    ... I'm right-justifying a column in a listbox that's in a subform. ... only occurs when I requery the listbox while in dataentry mode and while ... forms that have their DataEntry property set to "True". ...
    (microsoft.public.access.forms)
  • Re: Stop a form from saving itself when opened
    ... What makes you think it's saving itself? ... >I have a form with a large subform that saves ... > itself everytime it is opened. ... > functions in a function module. ...
    (microsoft.public.access.tablesdbdesign)