View Full Version : copy record values to next record


mukky
07-21-2010, 08:04 AM
Hello,
I need advice with the following code

I need to have recorded any new value created in the first recorded

sample

vbaInet
07-21-2010, 08:13 AM
I'm having difficulty understanding your request. Please elaborate.

mukky
07-21-2010, 09:57 AM
i need copy all records(rows table) from previous record (first record) to each next record
result - each record will be same

boblarson
07-21-2010, 10:01 AM
i need copy all records(rows table) from previous record (first record) to each next record
result - each record will be same

I'm with vbaInet on this. You are copying records - the same values - and that violates the rules of Normalization. So, we're trying to understand your business requirements and why you are actually doing this because it doesn't make sense from a properly normalized database perspective.

mukky
07-25-2010, 07:45 AM
i need insert values from table tab_material_add to table tab_material

in tab_material i have autonumber field

i try this code

Private Sub Form_Click()
DoCmd****nSQL "Insert into tab_material (ROHS) Select ROHS From tab_material_add "
Me.Requery
End Sub

thank you

here is sample

vbaInet
07-25-2010, 07:53 AM
Yes we understand your requirement but that's the wrong way to go about this. You shouldn't have the same records and the same fields in two separate tables.

mukky
07-25-2010, 08:32 AM
i need change records in table, add and remove or edit records

vbaInet
07-25-2010, 08:42 AM
Change the records to that table, don't insert it into another table.

Use a query for adding/editting to that table for that specific MaterialID. Run the query to filter the records. Then use the query as your form's Record Source.