update method

  • Thread starter Thread starter Shree
  • Start date Start date
S

Shree

Hi!
I have a unique situation.
I have 2 tables. One unbound form.
There are 10 fields in the form. 9 fields need to go to
tblONE and one field needs to go to tblTWO.
tblTWO already has the record with a uniqe id.(Say 1111).
One of the fields of this record(1111) is the field that
needs to come from the 'unbound form.'
I am using 'Addnew - .update' for sending data to tblONE
since I am creating a brand new record in this table for
(1111). How do I update the remaining one field from this
form to tblTWO where the record already exixts but just
needs data coming in to the required field. I tried 'Edit -
.update' method but am getting an error. Please help.
Thanks in advance for any kind of help!
Shree
 
what error you get?
you can also use update query to update tblTWO
but edit-update also ok
 
The error says "changes requested to the table are not
successful because it will create duplicate values in
index, primary key or relationship" its Error no 3022.
tblTwo already has this record. In the vba code that I am
writing, I am sending the id too. maybe that is why I am
getting this error. But how do i send the data to the
right record without specifying the id it needs to go to?
Please help!
 
Shree,

If in the second table recordset, you are doing a FindFirst
to get the right record, your Edit/Update should do fine as
long as you don't try to edit the ID. You should only be
editing or modifying the one field that you need to .

Gary Miller
Sisters, OR
 
Back
Top