[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2010
  • Last Modified:

How to change record in Microsoft Access.

I am use Microsoft Access, but i have a problem when i use.
 I hava a colum. Field Name =ID,  Data type=AutoNumber.
But now i want to del or change some record in ID, but it is not posible. Error" Control can't be edited. It bound to AutoNumber field 'ID".
How much i do to chang it.
It is very important .
Give me some advice. As soon as posible.
0
kidsrock
Asked:
kidsrock
  • 3
  • 2
  • 2
  • +3
5 Solutions
 
ArjiCommented:
You can change it from DataType 'AutoNumber' to DataType 'Number/long integer' and then you can edit it.  I would be careful to make sure you don't duplicate a number
0
 
mat128Commented:
Since you used AutoNumber first, you cannot edit that AutoNumber value since it is automatically inserted. You have to change the DataType of the field to Number then you will be able to edit it. After making the change, you *WONT* be able to change it back to AutoNumber.
0
 
Arthur_WoodCommented:
and if the autonumber field is being used as the Primary Key of your table, then changing it to Number  will mean that you then MUST - repeat MUST - generate new values for the Primary Key field in CODE - as chaning it to a NUMBER field will mean that it will no longer be automatically generated for you when you insert new records into the table.  

Why are you trying to edit the ID field in the first place?

AW
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
kidsrockAuthor Commented:
I don't known what do you say. Can you give me detail. Ok.
i want to del some record in table after that i want to change Field"ID".
0
 
grayeCommented:
The Autonumber isn't designed to do that...  in fact it's designed to specifically prevent you from renumbering the items in that field.   So that means if you had the following rows:

ID       Field1
12       Joe Blow
13       John Doe
14       John Q Public

After you delete row #13, the data would look like this:

ID       Field1
12       Joe Blow
14       John Q Public

You can't go back and change #14 to something else...  and the "dead" row ID of 13 will never be used again.

Now if this behavior is not what you want...  and you do indeed need to renumber the items in the ID field, then you must remove the Autonumber field or convert it back to an ordinary Numeric field.
0
 
ArjiCommented:
I thought the rules of this place state that you should give people credit for their comments.  mat128 and arthur wood both repeated something I said previously....look at the rules guys
0
 
ArjiCommented:
BTW, mat128, if you maintain unique IDs, you can in fact change it back to Autonumber.  All that is required is uniqueness.  Autonumber will continue from the last number + 1/
0
 
ajaypappanCommented:
insert one more field and make the field auto number and delete the old ID feild...  it should be fine... but every time u delete something u have to do the same.
0
 
kidsrockAuthor Commented:
to graye
i want to change 14-->13 after i del #row 13. How much i do.
If anybody know plz tell me. Thank a lot.
0
 
grayeCommented:
The best answer is to alter the database itself to change the Autonumber into a normal number (as discussed above by the other folks)

From Microsoft Access
1) click on the "Tables" icon to show the list of tables in your database
2) click on the table that's giving you the problem
3) click on the "Design" button above or right-click the table and select "Design View"
4) one of the items is going to show "Autonumber" in the DataType column... change that to "Number"

After you've done that... you can go back to your program and assign the row numbers to anything to you.  Tell us more about the program you're writting... is this a Microsoft Access application using VBA or is there some other programming language involved?

I suggest you go back and re-read all of the comments from the other folks who've been trying to help you... there is a lot of good information there.
 
0
 
ajaypappanCommented:
Go to table Design view---> insert one more column--> assign the column as auto number---> delete the old column.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 3
  • 2
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now