2 Replies - 1684 Views - Last Post: 17 November 2012 - 04:09 PM Rate Topic: -----

#1 frankwright1  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 93
  • Joined: 07-May 12

Auto Increment not working when adding record

Posted 17 November 2012 - 10:26 AM

Hi

Ive created a form on an sql database using visual studio and the standard navigation form.

The primary memberID column 'is identity' property is set to yes, with increment at 1 and seed at 1.

When I run the form and click to add a new record, the memberID textbox used to come up with -1 and would autocomplete. However this has stopped happening and I have to add this in manually.

Does anyone have any ideas why this could be?

Thanks
Frank

Is This A Good Question/Topic? 0
  • +

Replies To: Auto Increment not working when adding record

#2 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5465
  • View blog
  • Posts: 11,740
  • Joined: 02-June 10

Re: Auto Increment not working when adding record

Posted 17 November 2012 - 12:26 PM

Start by narrowing down where the problem is: Code or database?

Go to your VB solutions backups (wherever you keep your backups). Run one of your backups from when this used to work.

if it still works in the old backup but not in the current version then its in your code. If its broken in your backup, then something has changed in the database.
Was This Post Helpful? 0
  • +
  • -

#3 DoxramosPS  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 171
  • Joined: 07-October 12

Re: Auto Increment not working when adding record

Posted 17 November 2012 - 04:09 PM

I'd personally look for an issue in the database first to be honest. Typically if a column is set to an auto integer then it completes it on it's own without any code needed to update it, so it sounds like you inadvertently modified something in the tables section of your DB.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1