473,394 Members | 1,640 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

excel automation, cross tab query, parameterized queries

I've got a filter form to select customers, products, etc
and these are used in parameter queries, ie WHERE t_cuno Like
[Forms]![fmnuMain]![txtCust]

the parameter queries, roll up to a crosstab query, that is used to
create an excel worksheet
I use a queryDef structure to set the parameters, and that works fine

now, I've got to change the customer selection, to a multiple
selection, so the above changes to
WHERE t_cuno IN ( [Forms]![fmnuMain]![txtCust] )

which is invalid

I can use queryDef.sql to change the WHERE clause at excel creation
time, but that creates
db bloat

or I can call a function WHERE validCustno(t_cuno) = 1, which returns
1 is the custno matches
the user selection(s) but calling a function in a query really slows
it down

or I could create a temporary mdb in the user's myDocuments (multiple
users running on a
terminal server, so c:\temp won't work) which contains a customer
number selection table
with the selected IDs and then change my sub queries to join to this
table

what are other options ?
Nov 13 '05 #1
1 2051
Since you are using automation to populate Excel, I'm assuming there's no
reason you have to change the SQL of a saved querydef to do what you want,
just use a temporary querydef ( .CreateQuerydef with "" as the Name argument),
or open the regordset using the SQL string directly.

Presto - no MDB bloat.

On 26 Jan 2005 11:38:39 -0800, le*********@natpro.com (Roger) wrote:
I've got a filter form to select customers, products, etc
and these are used in parameter queries, ie WHERE t_cuno Like
[Forms]![fmnuMain]![txtCust]

the parameter queries, roll up to a crosstab query, that is used to
create an excel worksheet
I use a queryDef structure to set the parameters, and that works fine

now, I've got to change the customer selection, to a multiple
selection, so the above changes to
WHERE t_cuno IN ( [Forms]![fmnuMain]![txtCust] )

which is invalid

I can use queryDef.sql to change the WHERE clause at excel creation
time, but that creates
db bloat

or I can call a function WHERE validCustno(t_cuno) = 1, which returns
1 is the custno matches
the user selection(s) but calling a function in a query really slows
it down

or I could create a temporary mdb in the user's myDocuments (multiple
users running on a
terminal server, so c:\temp won't work) which contains a customer
number selection table
with the selected IDs and then change my sub queries to join to this
table

what are other options ?


Nov 13 '05 #2

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

Similar topics

9
by: Paul | last post by:
Hi all Arggghhh........... The problem.....I want the user to be able to create an excel document and name particular cells in the document where they want the data to be placed and then save...
1
by: Steven Stewart | last post by:
I have a user who has been using Excel for a while to keep statistics and print reports. She finds using it cumbersome because of long formulas and a lot of copying and pasting. I have designed...
8
by: deko | last post by:
I'm trying to open a Recordset based on a parameterized query. I'm kind of new to parameterized queries, so I'm sure I'm missing something simple. Set qdfs = db.QueryDefs Set qdf =...
3
by: Santa-D | last post by:
I've got an excel sheet that I need to import into a table, however, I want the function to automatically manipulate the data prior to it being imported. For example, i have a field called and...
29
by: wizofaus | last post by:
I previously posted about a problem where it seemed that changing the case of the word "BY" in a SELECT query was causing it to run much much faster. Now I've hit the same thing again, where...
8
by: Roland Hall | last post by:
In Access you use "*" + + "*", + can be replaced with & Calling a parameterized query in Access requires % be used in place of *, however, all that I have read show dynamic SQL passed to Access: ...
1
by: smaczylo | last post by:
Hello, I've recently been asked to work with Microsoft Access, and while I feel quite comfortable with Excel, I'm at a complete loss with databases. If someone could help me with this issue I'm...
4
by: Belgarath | last post by:
Hello all, I'm a newbie in Access... And before starting to explore this software, I would like to know if it's possible to automate everyday queries result in Excel . If it's possible can...
9
by: Peter | last post by:
..NET 3.5 I am using OleDb and ADO.NET to insert data into Excel spreadsheet everything works fine until I try to add a record with 256 fields, then I get "Too many fields defined." error. ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...
0
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.