Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2013

    Unanswered: CLearing Few boxes after duplicate


    I have kept a duplicate button to duplicate the current record but I would like to know how we can make
    1) few fields empty and
    2) Increment a particular NID field to the next highest number present in the database. ( This particular ID field contains duplicate values too, so Autonumber is eliminated from the options). I am trying to increment that ID to (Current Highest Value in DB for NID+1)

    Many Thanks.

  2. #2
    weejas is offline Grumpy old man (training)
    Join Date
    Sep 2006
    Surrey, UK
    Provided Answers: 18
    Bit tricky to advise on changes without knowing what needs to be changed! :P

    Post your code?
    10% of magic is knowing something that no-one else does. The rest is misdirection.
    Beers earned: 2

  3. #3
    Join Date
    Jun 2005
    Richmond, Virginia USA
    Provided Answers: 19
    In regard to the first question, you can Copy & Paste the Record into a New Record, then set the desired Controls to Null:

    Private Sub DupRecord_Click()
     If Me.Dirty then Me.Dirty = False
     DoCmd****nCommand acCmdSelectRecord
     DoCmd****nCommand acCmdCopy
     DoCmd.GoToRecord , , acNewRec
     DoCmd****nCommand acCmdPaste
    Me.Field1ToLeaveEmpty = Null
    Me.Field2ToLeaveEmpty = Null
    End Sub

    The forum's anti-spam software will not allow certain letter combinations, one of which is needed for run some commands, so in the code above, simply replace


    with the characters

    . R u

    (removing the spaces between the characters after inserting them)

    Linq ;0)>
    Hope this helps!

    The problem with making anything 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