> The combination of basketID and productID is unique
>
> "Douglas J. Steele" wrote:
>
>> You're attempting to add a second record with the same values of staffID
>> and
>> productID.
>>
>> If staffID and productID are the primary key, that's not allowed. (That's
>> the whole point of a primary key...)
>>
>> --
>> Doug Steele, Microsoft Access MVP
>>
http://I.Am/DougSteele>> (no private e-mails, please)
>>
>>
>> "h3llz" <h3llz[ at ]discussions.microsoft.com> wrote in message
>> news:199EB5FD-5227-4B67-A9D7-9867F63C5788[ at ]microsoft.com...
>> >i found the error, staffID and productID was keys and if i remove the
>> >keys
>> >it
>> > work, but why is this? (key violations)
>> >
>> > "h3llz" wrote:
>> >
>> >> DoCmd.RunSQL ("INSERT INTO tblProductsLog VALUES (" & [staffID] & ","
>> >> &
>> >> [productID] & "," & -[productQuantity] & ",'" & Now() & "');")
>> >>
>> >> staffID, productID, productQuantity are integer
>>
>>
>>