• cmd button (2k sr-1)

    Author
    Topic
    #357829

    help
    I would like to put a command button on a form so that after making changes to the record currently on the form, The user will click it and it will copy all the fields on the form and append them to another table named “tblBacklogChanges” and also add to the just copied record to additional fields “UserName” and “DateTime”
    John

    Viewing 1 reply thread
    Author
    Replies
    • #532421

      I would suggest putting the necessary code in your form’s AfterUpdate event (assuming it is a bound form). You can still have a button, but it merely does a Runcommand acCmdSaveRecord.

      As for the code, you merely have to create a string that contains the SQL code for an append query. Then use:
      Currentdb.execute strSQL

      Easiest thing to do is create the append query in QBE grid, then copy and paste the SQL string into your VBA code.

    • #532422

      What do you intend to do if the user doesn’t click the button? Relying on user actions to log changes is highly unreliable. Take a look at this article for an alternative approach.

    Viewing 1 reply thread
    Reply To: cmd button (2k sr-1)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: