PC Review


Reply
Thread Tools Rate Thread

Data Entry Form and Auto Number ID

 
 
frank
Guest
Posts: n/a
 
      11th Sep 2010
Hello,
My database has a Users Table and I am making a New User Form.
The Primary Key is UserID and it is an AutoNumber field.
I would like to have the form open on a new record with a new UserID.
The form opens on a new record OK, but it opens with a duplicate ID in
the User ID field.
Is there something I need to do so the new record will open with the
Auto Number properly incremented?
It is a simple bound form with dataentry set to true.

My table already has UserID values up to 555.
Each time I debug my form to add a new record, the Auto number field
increments from my last debug session but it is still low enough to
cause a duplicate value in the table.
For example, I have debugged 10 times.
The next time I test the form, a new record will be created with ID
11.
The next time with ID 12, etc...
These are still duplicates because the table already has UserIDs up to
555.
It should be pretty easy to make a Data Entry form with an Auto Number
PK, right?
Thanks
 
Reply With Quote
 
 
 
 
John W. Vinson
Guest
Posts: n/a
 
      11th Sep 2010
On Sat, 11 Sep 2010 12:59:14 -0700 (PDT), frank <(E-Mail Removed)>
wrote:

>Hello,
> My database has a Users Table and I am making a New User Form.
>The Primary Key is UserID and it is an AutoNumber field.
>I would like to have the form open on a new record with a new UserID.
>The form opens on a new record OK, but it opens with a duplicate ID in
>the User ID field.
>Is there something I need to do so the new record will open with the
>Auto Number properly incremented?
>It is a simple bound form with dataentry set to true.
>
>My table already has UserID values up to 555.
>Each time I debug my form to add a new record, the Auto number field
>increments from my last debug session but it is still low enough to
>cause a duplicate value in the table.
>For example, I have debugged 10 times.
>The next time I test the form, a new record will be created with ID
>11.
>The next time with ID 12, etc...
>These are still duplicates because the table already has UserIDs up to
>555.
>It should be pretty easy to make a Data Entry form with an Auto Number
>PK, right?
>Thanks


How are you "debugging" the form? The autonumber is assigned by the table (the
database engine), not by the form, so unless your debug is running some code
which is interfering, this should work.

What version of Access are you using? Is it up to date with all service
patches? There have been bugs in Access that cause reassignment of used
autonumbers, but I believe that all versions now have this bug fixed (if you
have the fixes installed of course!)
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/For...-US/accessdev/
http://social.answers.microsoft.com/.../en-US/addbuz/
and see also http://www.utteraccess.com
 
Reply With Quote
 
frank
Guest
Posts: n/a
 
      11th Sep 2010
On Sep 11, 4:09*pm, John W. Vinson
<jvinson@STOP_SPAM.WysardOfInfo.com> wrote:
> On Sat, 11 Sep 2010 12:59:14 -0700 (PDT), frank <frankjlin...@yahoo.com>
> wrote:
>
>
>
>
>
> >Hello,
> > *My database has a Users Table and I am making a New User Form.
> >The Primary Key is UserID and it is an AutoNumber field.
> >I would like to have the form open on a new record with a new UserID.
> >The form opens on a new record OK, but it opens with a duplicate ID in
> >the User ID field.
> >Is there something I need to do so the new record will open with the
> >Auto Number properly incremented?
> >It is a simple bound form with dataentry set to true.

>
> >My table already has UserID values up to 555.
> >Each time I debug my form to add a new record, the Auto number field
> >increments from my last debug session but it is still low enough to
> >cause a duplicate value in the table.
> >For example, I have debugged 10 times.
> >The next time I test the form, a new record will be created with ID
> >11.
> >The next time with ID 12, etc...
> >These are still duplicates because the table already has UserIDs up to
> >555.
> >It should be pretty easy to make a Data Entry form with an Auto Number
> >PK, right?
> >Thanks

>
> How are you "debugging" the form? The autonumber is assigned by the table(the
> database engine), not by the form, so unless your debug is running some code
> which is interfering, this should work.
>
> What version of Access are you using? Is it up to date with all service
> patches? There have been bugs in Access that cause reassignment of used
> autonumbers, but I believe that all versions now have this bug fixed (if you
> have the fixes installed of course!)
> --
>
> * * * * * * *John W. Vinson [MVP]
> *Microsoft's replacements for these newsgroups:
> *http://social.msdn.microsoft.com/For...-US/accessdev/
> *http://social.answers.microsoft.com/.../en-US/addbuz/
> *and see alsohttp://www.utteraccess.com- Hide quoted text -
>
> - Show quoted text -


SOLVED
You're quite right that it has nothing to do with the form.
If I open the table in datasheet view and add a new record it also
created a duplicate ID.
I am using 2003 SP3.

By debugging I just mean that I am switching to Form View which
creates a new record.
I deleted all the records in the table and loaded it with SQL again.
It began at the lower index it had been using.
It is now working properly.
I'm not sure how it got our of synch, but clearing and reloading the
table solved it.

Thanks for your assistance.




 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Entry using Auto Lookup query & Data Entry Form Bob N Microsoft Access Forms 3 28th Oct 2008 07:43 PM
mac excel auto-form data entry list box question niclane Microsoft Excel Discussion 0 25th Jun 2008 02:02 PM
Auto entry of data from form to subform =?Utf-8?B?Q2xldmVsYW5k?= Microsoft Access Forms 0 13th Jun 2005 06:25 PM
Auto Number with data entry Chhunhour Microsoft Access 5 6th Aug 2004 06:00 AM
Ascending data form auto-entry? lykwid Microsoft Excel Programming 2 24th Jan 2004 02:38 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:22 AM.