Primary Key re-setting to "0"

R

Richard Sunderland

I have a form with an underlying query for data input. It is brought up by
entering the primary key in a search parameter box. All works fine, except
when changing certain field details and then entering or tabbing to the next,
it resets the primary key to zero. The user then has to re-input the primary
key otherwise it returns the dupe values box on print or exit. Sometimes it
does not re-set the primary key but you still get the dupe values box.
Again, re-inputting the primary key solves it

I have replicated it on the underlying query so it's not the form that
causes it.

Any help appreciated, thanks
Richard
 
J

John Vinson

On Wed, 14 Sep 2005 01:46:02 -0700, Richard Sunderland <Richard
I have a form with an underlying query for data input. It is brought up by
entering the primary key in a search parameter box. All works fine, except
when changing certain field details and then entering or tabbing to the next,
it resets the primary key to zero. The user then has to re-input the primary
key otherwise it returns the dupe values box on print or exit. Sometimes it
does not re-set the primary key but you still get the dupe values box.
Again, re-inputting the primary key solves it

I have replicated it on the underlying query so it's not the form that
causes it.

Any help appreciated, thanks
Richard

Might the Primary Key field have a Default Value of 0? Or, is the
search textbox bound to a field? (It shouldn't be).


John W. Vinson[MVP]
 
R

Richard Sunderland

Upon checking the backend table, sure enough, the primary key default was set
to zero (i don't know why - must have been me though!) and removing this has
solved the problem. Thanks for your help

Rgds
Richard
 
J

John Vinson

Upon checking the backend table, sure enough, the primary key default was set
to zero (i don't know why - must have been me though!) and removing this has
solved the problem. Thanks for your help

Not your fault: Microsoft's!

For some unaccountable reason, the "default default" for all number
fields is 0, even when (as in this case) it makes no sense whatsoever
to have that or any other default.

John W. Vinson[MVP]
 
R

Richard Sunderland

John Vinson said:
Not your fault: Microsoft's!

For some unaccountable reason, the "default default" for all number
fields is 0, even when (as in this case) it makes no sense whatsoever
to have that or any other default.

John W. Vinson[MVP]


Microsoft "trying" to be helpful suppose! I will be careful of this in
future.

Thanks again
Richard
 
Top