Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Feb 2001
    Location
    Ohio
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    cmd button (2k sr-1)

    <img src=/S/help.gif border=0 alt=help width=23 height=15>
    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

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: cmd button (2k sr-1)

    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.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: cmd button (2k sr-1)

    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 <A target="_blank" HREF=http://www.mvps.org/access/modules/mdl0021.htm>this article</A> for an alternative approach.
    Charlotte

Posting Permissions

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