Results 1 to 5 of 5
  1. #1
    banpreet is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2016
    Posts
    117

    Copy Record button on form


    I made a post about revision control but after doing some more research, I feel like this will be an easier way to explain it. I would like to make a copy record button on a form. So just a little background, the user fills out the form, its go through an approval process, gets approved, but then some changes might need to be made to the form. So the user goes back to the form, instead of editing the information because it already has been approved, he goes to the form clicks on the button which will take him to another form which is the same form with all the information copied and another record stored in the table. Then the user just changes what he needs to and there will be a revision field which the user will then fill to 2, when on the first form it was 1. So now when look at the form, people can see two of the records linked to same master id but with some different changes. Hope this makes sense!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    instead of copying the record, why can you just make an approval field, and a 2nd field (for what ever), etc.?
    normally you dont want copies of records.

    but if you want copies, just run an append query from the ID on the current record.

  3. #3
    banpreet is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2016
    Posts
    117
    well once they make the copy then they switch the revision field and changes, in our company we need to keep track of changes, will append query do this? Not familiar with that function as I am not good with queries on access.

    Thanks!

  4. #4
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,511
    I already answered on your other duplicate post "Revision Control for Forms".

    Put button on form called Change Record or something. In the OnClick code, copy the current data fields to temp variables, initiate a new record, paste the values back into the fields of the new record, then Setfocus to the first field for them to make any changes.

    Dim vField1, vField2, vField3 As Variant
    Dim vRecNbr as Number

    vField1 = Me.Field1
    vField2 = Me.Fields
    vRecNbr = me.RecNbr

    DoCmd.GoToRecord , , acNewRec

    Me.Field1 = vField1
    Me.Field2 = vField2
    Me.RecNbr = vRecNbr + 1

    Me.Field1.SetFocus

    You probably want to sort the data on this form on RecNbr Descending to your most current record is first.

  5. #5
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    queries are the basis of access.
    make a copy and append the copy your table via append query.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 12
    Last Post: 02-11-2015, 07:00 PM
  2. Copy From Command Button (Acc2007 form)
    By psunilve in forum Programming
    Replies: 4
    Last Post: 04-03-2013, 06:11 AM
  3. Replies: 3
    Last Post: 03-09-2013, 10:39 AM
  4. Copy button on a form
    By MikeAllen in forum Forms
    Replies: 11
    Last Post: 08-29-2012, 06:20 AM
  5. Replies: 10
    Last Post: 03-21-2011, 02:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums