473,799 Members | 3,033 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

outputto or transferspreads heet with parameterized query?

I have a form in an Access Project that displays some records, and
based on the displayed records I'd like to output this to an excel
file, but I need to write more fields of the record than are shown in
the form. I'm not sure how I would do this.

I was considering creating a query that has the fields I want to use in
it, but because the form has a "ServerFilt er" criteria, I would need a
paramterized query so that the query is filtered the same as the form.

I'm not sure what the syntax would be though to use either of the
exporting functions with a parameterized query, if it is possible.

The server filter will be somewhat complex though. It would be better
if I could just take the current set of records being viewed in the
form and output those to an Excel file, but again there are fields of
each record that need to be in the output, but aren't on the form(they
are actually in a subform).

Thanks in advance.

Nov 13 '05 #1
6 2706
FYI: (Hint, hint): the query your form runs on can have more fields
then the user (or the form) works with...

Nov 13 '05 #2
Right, the query returns all fields, not just those displayed in the
form, but I have a problem. My form gets it's fields from a View
called [NotDropped] but when my form is opened it has a filter applied
to the ServerFilter property to narrow down the data. On top of that,
the user will apply a filter of their own to the datasheet. I only
want to output those records being viewed.

So if I pass NotDropped as the query, then it returns all the fields I
need, but not with the filtering I need.

That's why I was thinking I might need a parameterized query. But I'm
not sure if the transferspreads heet function will except that, or how I
would write that syntax.

Nov 13 '05 #3
I could maybe programmaticall y create and save a view query from
access. Is this possible?

Nov 13 '05 #4
ServerFilter Property? I'm not familiar with that property.
Personally, I just base a query on a view if I want to limit the
records.

Nov 13 '05 #5
Chuck, thanks for the reply.
If you have an Access Project setup as a front end to SQL server open
up form properties, there is a Server Filter property listed in the
properties. It is basically acts as something int he quere clause.

"Personally , I just base a query on a view if I want to limit the
records."

How do you limit the records returned by the view? Is this something
your doing in code? An example maybe please?

Nov 13 '05 #6
Sorry, I didn't catch that you were doing an ADP. I thought this was a
normal Access database.

Since it's an ADP, I really can't help. Sorry 'bout that.

Nov 13 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
6078
by: gary b | last post by:
Hello When I use a PreparedStatement (in jdbc) with the following query: SELECT store_groups_id FROM store_groups WHERE store_groups_id IS NOT NULL AND type = ? ORDER BY group_name
2
8052
by: deko | last post by:
This code is behind a button that exports the contents of a query ("qryXL_Tx") to an Excel spreadsheet. It works fine the first time, but will not run a second time. When I go to look at my query... it's blank! No SQL at all.... Any ideas why this sub is eating my query?? Private Sub cmdExportXL_Click() strXLfile = "Transactions_" & strTxType & strTxAcct & strQtr & strYr & ".xls"
1
6198
by: barma16 | last post by:
I've hit a bit of a brick wall here, and could use some advice. I have an Access application whose output is a four-tab Excel spreadsheet where three of the four tabs are the result of database queries. A number of fields in the queries are designed to become formulae in Excel after the export has taken place (and they need to be in Excel rather than Access). I need to use the TransferSpreadsheet Method rather than the OutputTo to enable...
3
11075
by: user_5701 | last post by:
Hello, I'm getting an error with a Docmd.Transferspreadsheet line of code: DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel2000, "tblTest", pathAndFilename, True The above line works perfectly fine, but when I change the table name argument (tblTest) to the name of a query, it fails and gives the following error:
2
16838
by: Hank | last post by:
Hello, I use TransferSpreadsheet on a daily basis using a Table as a datasource. I was under the impression from reading Help that you could also use a Query as the datasource. This is my code: (simplified here) strSQL = "SELECT FROM ;" DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel7, strSQL, Path, True
4
3045
by: deko | last post by:
When using OutputTo with a query, the 'File name' window in the 'Output To' dialog gets populated with the name of the query by default. This makes the exported file self-describing if the query is named on the fly. The benefit is consistent file naming, and users don't have to enter a file name when exporting. The problem is the query has to be renamed every time, and I don't know how to find it in the QueryDefs collection other than...
5
4621
by: sara | last post by:
I have reports that run from a form where the user can choose a date range, or they run automatically for a week in the "Weekly Reports" option. I created 2 queries and 2 reports - one query uses the WeekEndDate to filter, and its associated report heading says "For the week Ending " & forms!frmPrintReports.getWeekEndDate. The other query selects the date range using "Between" and the 2 dates on the form. Its associated report header...
5
9340
by: dancole42 | last post by:
I have a question regarding the DoCmd.OutputTo function. I have an invoice report that shows all of the invoices for a particular date. I want to create a button that will export each page of the report (i.e. each separate invoice) as a separate RTF file, and save each file with the date, a sequential number (starting with 01 for the first invoice on that date), and the value of the LastName field for that particular invoice in the...
3
3127
by: RZ15 | last post by:
Hi, I'm going to be giving many people an access database file with a switchboard with quite a few essential queries (query-by-form) so that they can pull data whenever they want. I have a button to export the file into excel as well. The issue I have is with this button. I used to have this button running a macro that would OutputTo in Excel format. Since this limits me to around 16k records because of it outputting into microsoft excel...
0
9688
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9544
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10490
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10259
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10030
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7570
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4145
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 we have to send another system
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.