Selecting and copying all records on a form
Selecting and copying all records on a form
(OP)
Hi, i am currently having trouble selecting and copying all of the records off a form using VB, I know it can be done easily of the menu's but I am trying to do it all from a button. I am using Access'97 and using the RunCommand action. I can get it to select all the records, no problem, but its then says that the copy command is unavailable. I know this must be quite simple.
RE: Selecting and copying all records on a form
I'm sure that we will be able to figure it out with a bit more information.
Kathryn
RE: Selecting and copying all records on a form
What i am exactly trying to do is to quickly copy a set of records from a form straight onto an Excel spreadsheet. I have done this before using a 'docmd.transferspreadsheet' action to transfer entire tables onto a spreadsheet but in this instance the data has to go onto a specific range of a specific worksheet, and I figured the easiest way would be to have a button on the form that copied all of the records and then then user could go to their Excel sheet and paste them where the required.
RE: Selecting and copying all records on a form
Kathryn
RE: Selecting and copying all records on a form
Martin
RE: Selecting and copying all records on a form
1. If the SQL doesnt' change, save the SQL as a query.
2. If the SQL changes, you can create a QueryDef in code, put your SQL in the QueryDef, save the QueryDef, and then use transferspreadsheet.
Does this sound like what you are looking for?
Kathryn
RE: Selecting and copying all records on a form
Martin
RE: Selecting and copying all records on a form
Only other thought I had is: Is there any rhyme or reason to the name of the excel spreadsheet? Is it related in any way to any of the data or to a criteria in your query?
Sorry I couldn't be of more help.
Kathryn
RE: Selecting and copying all records on a form
Thanks anyway Kathryn for spending time looking into my problem. My users will just have to copy off the Edit menu manualy.
Martin