Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    May 2002
    Location
    Roanoke, Virginia, USA
    Posts
    493
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Save Record (A2K SP3)

    I have a Command Button on a New Customer form that calls up a Check In form. The code is:

    Private Sub Check_In_Click()
    Dim strWhere As String
    strWhere = "RentPaidDate Between ReportBeg and ReportEnd"
    DoCmd.OpenForm "frmCheckIn", acNormal, , strWhere
    DoCmd.GoToRecord , , acNewRec

    End Sub

    I want to make sure that the Customer record is saved before the Check In form is called. I don't know the proper syntax to add to the on click event.

  2. #2
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Save Record (A2K SP3)

    Dim strWhere As String
    strWhere = "RentPaidDate Between ReportBeg and ReportEnd"
    DoCmd.RunCommand acCmdSaveRecord
    DoCmd.OpenForm "frmCheckIn", acNormal, , strWhere
    DoCmd.GoToRecord , , acNewRec

  3. #3
    4 Star Lounger
    Join Date
    May 2002
    Location
    Roanoke, Virginia, USA
    Posts
    493
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Save Record (A2K SP3)

    Dave,

    Many thanks.

    Tom

  4. #4
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Save Record (A2K SP3)

    Tom
    You're welcome.

    FYI

    The code I added although correct, might not be in the correct place.
    I placed it there because thats where you asked it to be (Before form is opened).
    If your code is fired right back to the Dim strWhere statement is declared, it may be better to add my code after the event which you are trying to save, ie After_Update of a record or field.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •