Go Back   Access World Forums > Microsoft Access Discussion > Modules & VBA

 
Reply
 
Thread Tools Rating: Thread Rating: 4 votes, 5.00 average. Display Modes
Old 09-03-2010, 07:32 AM   #1
Rx_
Nothing In Moderation
 
Rx_'s Avatar
 
Join Date: Oct 2009
Location: Denver, Colorado
Posts: 2,803
Thanks: 636
Thanked 337 Times in 307 Posts
Rx_ has a spectacular aura about Rx_ has a spectacular aura about Rx_ has a spectacular aura about
Exclamation [Solved] Select All records in datasheet view for copy

Trying to Copy All records in a Datasheet view into a variable.
Will use variable to paste into a new blank Excel worksheet (using vba).


A form (MyForm) with a SubForm (sfRowList) Default View as Datasheet. MyForm has a search to filter that works. And, the users like the feature to resort any column.

Once the users filter and sort the data, they can click in the upper left-hand corner of the header/row of the dataview and basically "Select All". Then they can paste the selected headers and records into Excel.


What is the VBA for the "Select All" and copy of the subform's data from the parent form (see button Copy to Excel in attachment)?
Attached Images
File Type: png SelectAll.png (25.6 KB, 625 views)
File Type: png sfROWList.png (10.8 KB, 474 views)

__________________
Were you lucky enough to get an answer? Please mark your question as [SOLVED] The original poster can go to Thread Tools to mark it as Solved.

Quotation Thomas Jefferson: "Peace is that brief glorious moment in history when everybody stands around reloading."

There are 2 Kinds of Countries on this Planet
1. Those that use the Metric System
2. Those that had a man walk on the moon

Denver, Colorado - The "Mile High City" - non-metric!

Last edited by Rx_; 09-03-2010 at 09:18 AM. Reason: solved
Rx_ is offline   Reply With Quote
Old 09-03-2010, 08:07 AM   #2
Rx_
Nothing In Moderation
 
Rx_'s Avatar
 
Join Date: Oct 2009
Location: Denver, Colorado
Posts: 2,803
Thanks: 636
Thanked 337 Times in 307 Posts
Rx_ has a spectacular aura about Rx_ has a spectacular aura about Rx_ has a spectacular aura about
Re: Select All records in datasheet view for copy

Wow, I had realized the recordset was the key and started doing this from scratch.
Thanks to your speedy response, the code you point to is just perfect for me to start with and modify for my own reporting format.

Thanks to you, I can finish early this Friday and enjoy our 3 day Labor Day weekend!
Your web page is in my Favorites! Thanks Heaps!
__________________
Were you lucky enough to get an answer? Please mark your question as [SOLVED] The original poster can go to Thread Tools to mark it as Solved.

Quotation Thomas Jefferson: "Peace is that brief glorious moment in history when everybody stands around reloading."

There are 2 Kinds of Countries on this Planet
1. Those that use the Metric System
2. Those that had a man walk on the moon

Denver, Colorado - The "Mile High City" - non-metric!
Rx_ is offline   Reply With Quote
Old 10-06-2015, 04:28 AM   #3
Snowflake68
Newly Registered User
 
Join Date: May 2014
Location: Hampshire, England
Posts: 372
Thanks: 235
Thanked 4 Times in 4 Posts
Snowflake68 is on a distinguished road
Re: Select All records in datasheet view for copy

Quote:
Originally Posted by boblarson View Post
Why not just use my code that I have available. Copy it into a standard module and then just call the procedure passing the form. It will send the filtered form to Excel.
Do you still have the code for this as the link no longer works.

Thanks

Snowflake68 is offline   Reply With Quote
Old 10-06-2015, 04:52 AM   #4
Rx_
Nothing In Moderation
 
Rx_'s Avatar
 
Join Date: Oct 2009
Location: Denver, Colorado
Posts: 2,803
Thanks: 636
Thanked 337 Times in 307 Posts
Rx_ has a spectacular aura about Rx_ has a spectacular aura about Rx_ has a spectacular aura about
Re: Select All records in datasheet view for copy

http://btabdevelopment.com/
Access Experts was nice enough to take the old Bob Larson BTABDevelopment site and preserve the code.
I won't have time to find the code you requested. If you do find it, please post it for others who follow.
__________________
Were you lucky enough to get an answer? Please mark your question as [SOLVED] The original poster can go to Thread Tools to mark it as Solved.

Quotation Thomas Jefferson: "Peace is that brief glorious moment in history when everybody stands around reloading."

There are 2 Kinds of Countries on this Planet
1. Those that use the Metric System
2. Those that had a man walk on the moon

Denver, Colorado - The "Mile High City" - non-metric!
Rx_ is offline   Reply With Quote
Old 10-06-2015, 06:02 AM   #5
arnelgp
error reading drive A:
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 8,569
Thanks: 68
Thanked 2,745 Times in 2,630 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: Select All records in datasheet view for copy

another alternative to copy all records displayed in subform:

DoCmd.GoToControl "sfRowList"
DoCmd.RunCommand acCmdSelectAllRecords
DoCmd.RunCommand acCmdCopy

__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
The Following User Says Thank You to arnelgp For This Useful Post:
Rx_ (10-06-2015)
Reply

Tags
copy , data view , select all , subform , vba

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I query all the records showing in the datasheet view of split form scooteman Queries 11 12-11-2009 04:45 PM
How to select records in singlerecord form using a datasheet subform? Maximnl Forms 0 06-06-2007 12:58 AM
How to control adding new record in Datasheet view usermj Forms 1 01-19-2005 06:12 AM
ordering records by datasheet view order... Tracy General 1 09-16-2002 09:57 AM
Large SQL Statement afortney Queries 3 08-29-2001 04:50 PM




All times are GMT -8. The time now is 03:18 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World