If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How can I cut and paste output from a form?
I have a form that does a query, processes the records
using VBA, and produces some rows and columns of data as output. In addition to seeing the results on the form, my users like to be able to cut and paste the data from the form to an Excel spreadsheet. I just wrote the code to put my output into a list box only to find that I can't cut and paste from a list box. Even with the Multiselect property set to "Extended", cut and paste captures only one column of data. I know a datasheet subform would let me cut and paste but they're set up for data from queries or tables and I don't know how to feed data into a datasheet subform from VBA. I guess I could try writing the output to a text box but I don't think that will handle the columns very well. Questions: 1) Is there an easy way to make the list box let me cut and paste it's entire contents? 2) If not, how can I write data to a datasheet subform from VBA code? 3) Any other ideas? I'm doing this in Access 2000. Thanks. |
#2
|
|||
|
|||
How can I cut and paste output from a form?
Using Cut and Paste in an application is a very bad idea. The correct way to
do this is to use the TransferSpreadsheet method (or action) to export the data to Excel. "Billy Smith" wrote: I have a form that does a query, processes the records using VBA, and produces some rows and columns of data as output. In addition to seeing the results on the form, my users like to be able to cut and paste the data from the form to an Excel spreadsheet. I just wrote the code to put my output into a list box only to find that I can't cut and paste from a list box. Even with the Multiselect property set to "Extended", cut and paste captures only one column of data. I know a datasheet subform would let me cut and paste but they're set up for data from queries or tables and I don't know how to feed data into a datasheet subform from VBA. I guess I could try writing the output to a text box but I don't think that will handle the columns very well. Questions: 1) Is there an easy way to make the list box let me cut and paste it's entire contents? 2) If not, how can I write data to a datasheet subform from VBA code? 3) Any other ideas? I'm doing this in Access 2000. Thanks. |
#3
|
|||
|
|||
How can I cut and paste output from a form?
Thanks for your help. It looks like the TransferSpreadsheet action
requires a table or query as a data source and my data are in a set of arrays and objects in my VBA code. I guess as a workaround I could write it all to a table and then use TransferSpreadsheet. Why is using cut and paste a bad idea? It seems to work and my users like it. "Klatuu" wrote in message ... Using Cut and Paste in an application is a very bad idea. The correct way to do this is to use the TransferSpreadsheet method (or action) to export the data to Excel. "Billy Smith" wrote: I have a form that does a query, processes the records using VBA, and produces some rows and columns of data as output. In addition to seeing the results on the form, my users like to be able to cut and paste the data from the form to an Excel spreadsheet. I just wrote the code to put my output into a list box only to find that I can't cut and paste from a list box. Even with the Multiselect property set to "Extended", cut and paste captures only one column of data. I know a datasheet subform would let me cut and paste but they're set up for data from queries or tables and I don't know how to feed data into a datasheet subform from VBA. I guess I could try writing the output to a text box but I don't think that will handle the columns very well. Questions: 1) Is there an easy way to make the list box let me cut and paste it's entire contents? 2) If not, how can I write data to a datasheet subform from VBA code? 3) Any other ideas? I'm doing this in Access 2000. Thanks. |
#4
|
|||
|
|||
How can I cut and paste output from a form?
Losts of chances for errors and possible loss of data in your tables if not
done correctly. Cut and Paste really has no place in a professional Access application. "Billy Smith" wrote: Thanks for your help. It looks like the TransferSpreadsheet action requires a table or query as a data source and my data are in a set of arrays and objects in my VBA code. I guess as a workaround I could write it all to a table and then use TransferSpreadsheet. Why is using cut and paste a bad idea? It seems to work and my users like it. "Klatuu" wrote in message ... Using Cut and Paste in an application is a very bad idea. The correct way to do this is to use the TransferSpreadsheet method (or action) to export the data to Excel. "Billy Smith" wrote: I have a form that does a query, processes the records using VBA, and produces some rows and columns of data as output. In addition to seeing the results on the form, my users like to be able to cut and paste the data from the form to an Excel spreadsheet. I just wrote the code to put my output into a list box only to find that I can't cut and paste from a list box. Even with the Multiselect property set to "Extended", cut and paste captures only one column of data. I know a datasheet subform would let me cut and paste but they're set up for data from queries or tables and I don't know how to feed data into a datasheet subform from VBA. I guess I could try writing the output to a text box but I don't think that will handle the columns very well. Questions: 1) Is there an easy way to make the list box let me cut and paste it's entire contents? 2) If not, how can I write data to a datasheet subform from VBA code? 3) Any other ideas? I'm doing this in Access 2000. Thanks. |
Thread Tools | |
Display Modes | |
|
|