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

Copy/Paste Functionality for Entire Subform

Status
Not open for further replies.

cstuart79

Technical User
Nov 2, 2009
171
US
This seems like it should be simple enough but I have been unsuccessful in locating an answer. I want to be able to copy all fields in a subform with the click of one button. Then I will be pasting this info into an email or Word document. So basically, I want to perform a function similar to a "Select All" and "Copy", or "Duplicate Record button" but without automatically pasting as a new Access entry. If you can suggest VBA code to paste into "On Click" event of button that would help a ton.
 
Well there are some different ways.

Are you selecting all the data for one particular record, or else is the record count limited to some number, or is it just totally unlimited?

Next question, is it always the same static fields? Do the fields ever change, or do you ever need different fields?

--

"If to err is human, then I must be some kind of human!" -Me
 
could be entire table (multiple fields, unlimited records) or just a few fields within 1 record depending on needs at the time.

ideally it could work just like copy/paste in a Word doc. however, my thought was to simplify it by having a "select all" button to highlight all fields and records in an entire subform or to have a "copy" button next to each particular record (highlighting all fields for that record)
 
Well, if this table is or could be rather large, then this may not be a good idea anyway. I mean, you could end up causing Word to crash if you try to "paste" too much to it. Then again, you could have a one-click solution, possibly, that basically just transfers the data out to Word in a process, rather than just one big slap of a copy/paste. ;p

I'd initially look at creating a recordset of the underlying table, and taking that recordset, and feeding all the data into a string variable.... However, there may very well be a better way. For a few records/fields, this is no big deal. But for a large sample of data, this could cause some system hiccups for sure.

--

"If to err is human, then I must be some kind of human!" -Me
 
understood. relative to causing Word to crash, the data is not that large. can you explain further your suggestions "for a few records/fields...no big deal"? i am new to using recordset and string variables.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top