Copy and paste (1 Viewer)

FCVIII

Registered User.
Local time
Today, 06:08
Joined
Jun 13, 2002
Messages
14
What code do I need to copy a value from one table and paste to another table. I dont want to copy the entire table or the enire field just one stupid "cell"

Any assistance would be greatly appreciated!!
Thanx
 

RV

Registered User.
Local time
Today, 11:08
Joined
Feb 8, 2002
Messages
1,115
Try using an UPDATE statement.

RV
 

FCVIII

Registered User.
Local time
Today, 06:08
Joined
Jun 13, 2002
Messages
14
Copy and Paste cont....

I have been searching for sample code to show how "update" works but everything I find refers to copying entire records I need one field from a particular record at a time.
Any suggestions?

Thank you
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 06:08
Joined
Feb 19, 2002
Messages
43,302
You should be able to find the code samples that you need in help by looking for OpenRecordset, Update, AddNew, FindFirst, and MoveNext.

BTW, tables don't have "cells", they have rows and columns which despite the visual similarity of a datasheet and a spreadsheet, are very different.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 05:08
Joined
Feb 28, 2001
Messages
27,194
Pat is right. Thinking about CELLS in a table indicates that you are perhaps misunderstanding what you are trying to do.

CELLS in a spreadsheet can be anything, do anything. But they don't organize as well as fields in a table. Fields CANNOT be just anything. They have to have values consistent with the field descriptor. Cut/Paste would run into that problem really fast unless you were merely copying from field X in row n to field X in row m.

But besides that, I have had a devil of a time using Cut and Paste functions within Access code. Don't know why, other than the obvious...

If you can open the recordset with VBA, you can just transfer the data to a variable, then update another recordset. Cut/Paste (in the formal sense of a .Cut method or .Paste method isn't really necessary if you have recordset control at the base code level.

That might be why coding Cut & Paste turns into such a bear of a problem.
 

FCVIII

Registered User.
Local time
Today, 06:08
Joined
Jun 13, 2002
Messages
14
Copy and Paste cont....

Good explanation. Thank you!!

I am still thinking like an excel user. I will play with the other codes that you mentioned. Ill let you know how it turns out

Peace
 

Users who are viewing this thread

Top Bottom