Results 1 to 2 of 2
  1. #1
    Star Lounger
    Join Date
    Mar 2003
    Location
    Summerville, South Carolina, USA
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Saving current record (Access 2000)

    I need a way to save a record without using the docmd.gotorecord function.

    I have a form that once a date (txtauditDate) is filled in, I want to lock the sub form so no changes can be done. If I only have one record on the form (or it is the first record), the gotorecord command returns an error. Plus if it does work, the screen flashes because it is changing records.

    I have tried the repaintobject or refresh, but neither seem to work. Is there a way to save the record with out changing records?

    Thanks.

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

    Re: Saving current record (Access 2000)

    I can't see why you us the gotoRecord action here but, if you want to save the record and then the subform be updated
    you should save the record immediately after entering it.

    Paste:
    DoCmd.RunCommand acCmdSaveRecord
    in the afterUpdate of txtAuditDate

    If you want to lock the subform you will need a Case statetement, or an If statement or a Where statement.

    I use an if statement, you could use this as an idea.

    If Me.InvoiceNo > 0 then
    Me.sbfVehicle.enabled = False

    or

    Me.sbfVehicle.Locked = True

Posting Permissions

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