473,491 Members | 2,074 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to send form contents to MS Excel?

13 New Member
Hi guys,

I have a tabular form that contains header section and detail section. The header section is used for searching and applying filters. The header section is not bound to any table in the database. Basically, users can enter their search criteria in the header section and see results in the details section.

How can I send the results (so only the fields from details section) to MS Excel? I can't use DoCmd.TransferSpreadsheet, because this method can only be based on a table or a query and not on a form. When I use OutputTo method it sends to Excel also the contents of the header section, which I absolutely don't want.

Thanks for any help!
Jan 3 '08 #1
5 2056
jaxjagfan
254 Recognized Expert Contributor
Hi guys,

I have a tabular form that contains header section and detail section. The header section is used for searching and applying filters. The header section is not bound to any table in the database. Basically, users can enter their search criteria in the header section and see results in the details section.

How can I send the results (so only the fields from details section) to MS Excel? I can't use DoCmd.TransferSpreadsheet, because this method can only be based on a table or a query and not on a form. When I use OutputTo method it sends to Excel also the contents of the header section, which I absolutely don't want.

Thanks for any help!
Make a query that uses your header as its criteria and then use the TransferSpreadsheet method to export the query.
Jan 3 '08 #2
jarekz
13 New Member
Make a query that uses your header as its criteria and then use the TransferSpreadsheet method to export the query.
Thanks, but some of the fields in the header are using filters. How do I use filters in a query?
Jan 3 '08 #3
jaxjagfan
254 Recognized Expert Contributor
Thanks, but some of the fields in the header are using filters. How do I use filters in a query?
What type of controls are you using in the header (TextBoxes, ComboBoxes, ToggleButtons, CheckBoxes, etc)? What are the names of these controls? What is your data table name and field names?

A simplistic view of possible SQL.
Select MyTable1.MyField1 from MyTable1 Where MyField1 = [txtHeader1];

If you use the QBE grid to build you query and use the builder and select forms. It will display the names of your controls to choose from. In my sample above I would have had a textbox control named "txtHeader1".
Jan 3 '08 #4
jarekz
13 New Member
Thanks for your reply, jaxjagfan.
All controls in my header are text boxes. Some of them contain texts, some numbers and some dates.
I see one problem with the query that you posted. Not all search criteria fields are always filled in. What if txtHeader1 is empty and only txtHeader2 is filled in? The query will not work...
Jan 3 '08 #5
jarekz
13 New Member
Why is it so complicate? Isn't it possible to just send the current recordset of the form after the users have chosen their search criteria?
Jan 4 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

4
1893
by: Kurien Baker Fenn | last post by:
How to send data from an ASP form to a visual basic form? Please help
1
4452
by: mhawkins19 | last post by:
I have a form built and on the onclick event I validate all of the fields and then if the form is ok, on the submit event I run a javascript function to set a cookie and download a file from the...
5
2703
by: sifar | last post by:
Hi, This is my first post to this Group. A] I am trying to create a escalation page which will mail an escalation report of a faulty product. Items needed on Page: -----------------------
2
1419
by: Steve Bishop | last post by:
I have an application that sends a query by e-mail in Excel format using a DoCmd.SendObject statement in VBA. I need to delete the column headings now before I send it. Help appreciated. Thanks....
5
3709
by: wylie72 | last post by:
I would like to redirect a form to output it's recordset to Excel rather than the Access report. I have the code to send SQL or a recordset to Excel, but how do I extract the datasource from the...
9
3126
by: eswanson | last post by:
I have a web page I need to post a file plus some other fields to it. How can I do this from a asp.net page. I know I can send individual fields to the other page, but how do I send a file to the...
5
2442
by: Sean | last post by:
Hi... I want to use the macro/sendobject (or any other procedure) to send the contents of a table (very small, ~5 rows/columns) as an Outlook message body, not as an attachment. Access 2000 will...
10
8917
by: Aj Blosser | last post by:
Hey guys, I have a question for you, I have a setup where I'm sending files through the POST to a php web page, I read the file contents, put that file contents as text into the POST string, and...
2
12495
by: hapnendad | last post by:
I am using a selection_change event on a worksheet to launch a userform that will populate the cell when a selection is made from a drop down list box on the form. Selection_change shows form if cell...
0
7115
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7154
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7190
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7360
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5451
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4578
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1392
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
633
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
280
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.