Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2003
    Posts
    3

    Question Unanswered: updating new records in VB

    hello,

    How is it possible to add a value in a record when you use a form to enter informations ? 3 textboxes in the form with a source table which contains 4 fields, the three first fields are completed with the form, the fourth with a mathematical function when you validate the last textbox of the form and then you pass to the following record and so on...

    Thanks for answers,

    jm
    Attached Files Attached Files

  2. #2
    Join Date
    Apr 2003
    Location
    Santa Barbara, CA
    Posts
    67

    Re: updating new records in VB

    Originally posted by jm_san
    hello,

    How is it possible to add a value in a record when you use a form to enter informations ? 3 textboxes in the form with a source table which contains 4 fields, the three first fields are completed with the form, the fourth with a mathematical function when you validate the last textbox of the form and then you pass to the following record and so on...

    Thanks for answers,

    jm
    What you have:

    'this is a hard save, when Access rolls to a new or next record it automatically saves the record.
    DoCmd.RunCommand (acCmdSaveRecord)

    'this cause the NEXT record's third field to be modified, not the record in view on the form???
    DoCmd.GoToRecord , , acNext
    Me.Recordset.Edit
    Me.Recordset(3) = 12 'désigne le champ 3 de l'objet RecordSet lié au formulaire en cours, raccourci de Me.RecordSet.Fields(3).Value
    Me.Recordset.Update

    'this causes the the current record never to come in to view. So the movement through the records is look at 1 modifiy 2 move go to 3 etc.
    Me.Recordset.MoveNext


    a less convoluted method is:

    sub cmdCheck_onclick()

    Me!tfact = 12
    DoCmd.GoToRecord , , acNext

    end sub

Posting Permissions

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