Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2012
    Posts
    7

    Unanswered: Auto opening a record in a form after copy

    Hi,

    I found this post back from 2006 by Missinglinq and worked perfectly for me, I wanted to see if if there was a way I could have access auto open the record I just created so I can add the addition (non copied) information into the record. So I would like to do is hit the command button, the record will be created in the table but then a form pop up that allows me to edit additional information that was not copied in the event.

    Thanks!


    'Copy fields from original record to variables
    NewField1 = Me.YourField1
    NewField2 = Me.YourField2
    NewField3 = Me.YourField3

    'Go to a new record
    DoCmd.GoToRecord , , acNewRec

    'Plug in values from the original record into the new record
    Me.YourField1.Value = NewField1
    Me.YourField2.Value = NewField2
    Me.YourField3.Value = NewField3

    'Now set the fields your user wants to change to blanks
    Me.YourField4.Value = ""
    Me.YourField5.Value = ""
    Me.YourField6.Value = ""

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Well, the form the code is in would be at that record, so you could put the fields there. If you want a new one, make sure the record is saved then use this:

    Open a second form to the record
    Paul

  3. #3
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    As Paul said, when the code you posted finishes executing, you will be sitting on the newly created Record on the Form whose Record you partially copied! Why would you need to popup another Form in order to complete your data entry?

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

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