Results 1 to 6 of 6
  1. #1
    Sham is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2012
    Posts
    3

    Copy autofill primary key field to another field

    Hello guys,


    I head is frozen, My table called Table1 has a primary key field (called RefID) with AutoNumber format. My problem is I want duplicate value of RefID field to another field called DupID. I want DupID to be changed, but I don't want any change on RefID field whenever I make changes. Does anybody have any idea??

    Thank you,
    Really appreciated.....

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    What have you tried so far? I don't see any problem as far as Access is concerned.

  3. #3
    Sham is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2012
    Posts
    3
    I created a query with all fields from the table, and added a new field on query to store duplicate data. Typed Expr1: RefID in the new field, field name. Now I get all duplicate data of RefID in DupID. But I can not change DupID, I think because of the source field is AutoNumber format..

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Quote Originally Posted by Sham View Post
    I created a query with all fields from the table, and added a new field on query to store duplicate data. Typed Expr1: RefID in the new field, field name. Now I get all duplicate data of RefID in DupID. But I can not change DupID, I think because of the source field is AutoNumber format..
    I believe you cannot change the field because your new field contains a formula. I thought you were doing this in the BeforeUpdate event of a Form.

  5. #5
    Sham is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2012
    Posts
    3
    Quote Originally Posted by RuralGuy View Post
    I believe you cannot change the field because your new field contains a formula. I thought you were doing this in the BeforeUpdate event of a Form.
    yes I used a form, ok thank you so much, I'll find some other solutions if i can....

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    So you got it to work using a form, right? Are you ready to mark this thread as Solved?

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

Similar Threads

  1. Autofill field based on other field
    By gwunta in forum Forms
    Replies: 1
    Last Post: 02-27-2012, 03:01 AM
  2. Replies: 1
    Last Post: 02-20-2012, 01:02 PM
  3. Replies: 5
    Last Post: 10-14-2011, 09:56 AM
  4. Replies: 1
    Last Post: 02-04-2011, 04:58 AM
  5. Autofill field based on autonumber field
    By frevilla in forum Forms
    Replies: 1
    Last Post: 09-11-2009, 02:50 AM

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