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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying data from one field into another field

Status
Not open for further replies.

njv

Technical User
Feb 23, 2002
1
US
I'm trying to copy the data that's in a group of fields into another field in a different table, but I'm not too savvy with VBA. This is the VBA someone recommended, but not sure why it's not working.

Basically;
I have one table (tblParts) that has a field (Price). I want to take the sum of all the Price fields (linked together by an (Invoice_Link) field), then supply that total into the (Parts_Total) field in another table (tblInvoice). The two tables are joined by the (Invoice_Link) field in one table and the (ID#) field in the other table which are the same number.

Why doesn't this work?

Private Sub Price_Change()
Dim MyRe As DAO.Recordset, MyDb As DAO.Database
Set MyDb = CurrentDb
Set MyRe = MyDb.openrecordsource("Select * from tblParts where Invoice_Link=" & Me!ID#)
MyRe.Edit
MyRe!Price = Me!Parts_Total$
MyRe.Update
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top