Microsoft Access Autonumber Key problem (1 Viewer)

asadkhan

Registered User.
Local time
Today, 19:27
Joined
Oct 26, 2019
Messages
52
Hello Sirs,

I have a form which recently started behaving strangely; the primary key is Autonumber, when I save my record by tabbing out of last field, it goes straight to next new record and shows a next number in the Autonumber primary key, instead of showing (NewRecord) entry in the autonumeber primary key. Same thing happens when form opens. The nature of database requires that new record entry/record should only start/created when first control other than autonumber PK is edited or something is typed in it. Which is also nornaly the case in autonumber primary key or anyother primary key control.

I would appreciate if anyone can kindly help. I am in the last stages of this project. It was working fine but i dont know whats gone wrong.

Thank you in advance for your help.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 11:27
Joined
Oct 29, 2018
Messages
21,467
Hi. Sounds like the form is getting dirty right away. Do you have any code assigning any value to a control on the form? That could cause the form to get dirty.
 

asadkhan

Registered User.
Local time
Today, 19:27
Joined
Oct 26, 2019
Messages
52
Hi. Sounds like the form is getting dirty right away. Do you have any code assigning any value to a control on the form? That could cause the form to get dirty.
There's plenty of code there but nothing which assigns value to any control.
 

smig

Registered User.
Local time
Today, 21:27
Joined
Nov 25, 2009
Messages
2,209
There's plenty of code there but nothing which assigns value to any control.
You probably either assign a value to one of the fields by code or by a default value on the form.
 

asadkhan

Registered User.
Local time
Today, 19:27
Joined
Oct 26, 2019
Messages
52
Thanks for all advice
Yes it was something very stupid I have done, I redisgned the form going one code at a time and found the culprit. Removed it and it working fine.
Thanks ever so much.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 11:27
Joined
Oct 29, 2018
Messages
21,467
Thanks for all advice
Yes it was something very stupid I have done, I redisgned the form going one code at a time and found the culprit. Removed it and it working fine.
Thanks ever so much.
Hi. Congratulations! Glad to hear you got it sorted out. Good luck with your project.
 

asadkhan

Registered User.
Local time
Today, 19:27
Joined
Oct 26, 2019
Messages
52
Thanks it's a very good project, I work for NHS.
 

Users who are viewing this thread

Top Bottom