duplicate record error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm having trouble filling in a form. The table has a combination primary key
made up of two fields which together make a unique key. As i enter values
into the filed the form detects that the value is a duplicate before I finish
typing the value.

e.g.

I have two fields

id id2
-----------
1 1
1 2
1 1.1
1 1.2

as i fill in the id2 filed in the form it put in a number like 1.3 it
detects the value as i type it and picks out the 1 as being a duplicate
before i get a chance to finish typing 1.3

can anyone help
 
What's the data type of id2? It sounds as though you've made it an Integer
(or Long Integer), so that the decimal part is being ignored.
 
If the id2 field type is iteger or long it will round the number and this is
why you get a duplicate error.
Chenge the field type to double or single so it will accept the decimal places
 
the data type of id2 is 'text'.
Ive never had this problem before. It appears to be something in the form
cause when I make a new form from the table it works fine. The form has alot
of subforms and buttons in it so I'd rather not have to redo it all.
 
Did you check for code to the On Change event of the textbox control? If you
have something running against that event you may need to change it to the
After Update event...
 
I have nothing running against the event

SusanV said:
Did you check for code to the On Change event of the textbox control? If you
have something running against that event you may need to change it to the
After Update event...
 
the id2 field is type 'text'

Ofer said:
If the id2 field type is iteger or long it will round the number and this is
why you get a duplicate error.
Chenge the field type to double or single so it will accept the decimal places
 
Back
Top