A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How can I cut and paste output from a form?



 
 
Thread Tools Display Modes
  #1  
Old August 28th, 2006, 03:30 AM posted to microsoft.public.access.forms
Billy Smith
external usenet poster
 
Posts: 25
Default 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  
Old August 28th, 2006, 02:11 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default 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  
Old August 28th, 2006, 03:27 PM posted to microsoft.public.access.forms
Billy Smith
external usenet poster
 
Posts: 25
Default 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  
Old August 28th, 2006, 03:41 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:51 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.