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

Recordset question

Status
Not open for further replies.

pvsmith5

Programmer
Mar 22, 2004
52
US
I have several tables that I would like to use the recordset object to update.

An example of the first table looks like this:
Col1 Col2 Col3 Col4 Calculation
Record 1 1 2 3 4 45
Record 2... 52
Record 3... 59

And I would like to take the calculation value from the first table, first record and put it here, in another table:
And record1 could be linked by a set ID number, since
Col1 Col2 Col3 Col4 Table1Calculation
Record 1 5 6 7 8 45
Record 2 52
Record 3 59

I've been trying something like this:

If rst1.[record1]=rst2[record1] then
rst1.Calculation=rst2.Table1Calculation
rst1.update

Is there something I'm missing here?

 
Hi pvsmith5,

Before you can change anything in a record in a recordset, you must switch to edit mode ..

Code:
[blue]If rst1.[record1]=rst2[record1] then
    [red]rst1.edit[/red]
    rst1.Calculation=rst2.Table1Calculation
    rst1.update[/blue]

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
Thanks for your help. A little detail that makes a big difference.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top