Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

copy record does not copy all fields

Status
Not open for further replies.

rjmdt

Programmer
May 17, 2002
38
US
I have a form that I use to copy records and then change a few fields to create a new record. A few fields do not copy one of them is a primary index key. When I try and save the record it gives me an error null primary key error. Do I have to have the field on my form for it to copy? Another possible thought is how do I update the primary key from two of the fields that do copy on the form. The primary key is made up of two fields that are copied then the user makes the changes to these fields, I would like for it to update the primary key before updating the record.

Thanks in advance
 
Hi

You need to explain how you are copying the data, for example do you execute an SQL Insert Command to create a new record with data from the Form, or what ?

Regards
Ken Reay
Freelance Developer
kenneth.reay@talk21.com
 
I am afraid you cannot copy whole record because primary index key is set to be unique.
Why don't try to build up a set of controls with definite values (comboboxes and/or listboxes and/or textboxes) bound to fields you need to change rarely and textboxes bound to fields you have to change every time you add a new record.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top