954,566 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Access 2007 Pass Thru query Syntax

Can I get some assistance with the T SQL syntax required to use the contents of this combo box in a pass thru query in order to improve performance response time over the LAN

[Forms]![WELCOME]![FILTER_BUILDER].[Form]![Combo28]


Apparently TSQL doesn't like the "!" from Access:

SELECT dbo_A_VIEW_LOWEST_LEVEL.contract, dbo_A_VIEW_LOWEST_LEVEL.[Profit Center Name], dbo_A_VIEW_LOWEST_LEVEL.MATERIAL_DESC, dbo_A_VIEW_LOWEST_LEVEL.cust_Name, dbo_A_VIEW_LOWEST_LEVEL.cust_id, dbo_A_VIEW_LOWEST_LEVEL.mat_id, dbo_A_VIEW_LOWEST_LEVEL.pc, dbo_A_VIEW_LOWEST_LEVEL.MEMO, dbo_A_VIEW_LOWEST_LEVEL.SUP_ACCT, dbo_A_VIEW_LOWEST_LEVEL.act_id, dbo_A_VIEW_LOWEST_LEVEL.actuals, dbo_A_VIEW_LOWEST_LEVEL.budget, dbo_A_VIEW_LOWEST_LEVEL.forecast, dbo_A_VIEW_LOWEST_LEVEL.link, dbo_A_VIEW_LOWEST_LEVEL.bud_var, dbo_A_VIEW_LOWEST_LEVEL.fcst_var, dbo_A_VIEW_LOWEST_LEVEL.CDEPMNT, dbo_A_VIEW_LOWEST_LEVEL.MNTATT, dbo_A_VIEW_LOWEST_LEVEL.MNTCM, dbo_A_VIEW_LOWEST_LEVEL.MNTCPI, dbo_A_VIEW_LOWEST_LEVEL.MNTCPROB, dbo_A_VIEW_LOWEST_LEVEL.MNTHELD, dbo_A_VIEW_LOWEST_LEVEL.MNTIMPOC, dbo_A_VIEW_LOWEST_LEVEL.MNTIMSD, dbo_A_VIEW_LOWEST_LEVEL.MNTMIGR, dbo_A_VIEW_LOWEST_LEVEL.MNTOTH, dbo_A_VIEW_LOWEST_LEVEL.MNTQ4IM, dbo_A_VIEW_LOWEST_LEVEL.MNTRECVD, dbo_A_VIEW_LOWEST_LEVEL.MNTSWSD, [pc] & [cust_id] AS CUSTLINK, dbo_A_VIEW_LOWEST_LEVEL.MNTIMPOC
FROM dbo_A_VIEW_LOWEST_LEVEL
WHERE (((dbo_A_VIEW_LOWEST_LEVEL.SUP_ACCT)=[Forms]![WELCOME]![FILTER
miweiser
Newbie Poster
12 posts since Oct 2009
Reputation Points: 10
Solved Threads: 0
 

From what I could determine, it looks like the only way to accomplish that is to dynamically create the query with the desired criteria. Pass-through queries cannot use parameters and they are parsed and run on the remote server. They don't have any knowledge of your local database and its forms.
Here's just one of the links I ran across that discusses it: http://www.pcreview.co.uk/forums/thread-1182381.php

You could probably create the query based on the update event from the combo box if you wanted to go that route.

Ezzaral
Posting Genius
Moderator
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
 

From what I could determine, it looks like the only way to accomplish that is to dynamically create the query with the desired criteria. Pass-through queries cannot use parameters and they are parsed and run on the remote server. They don't have any knowledge of your local database and its forms. Here's just one of the links I ran across that discusses it: http://www.pcreview.co.uk/forums/thread-1182381.php

You could probably create the query based on the update event from the combo box if you wanted to go that route.

Thank you very much, I was leaning towards that reality, now I will weigh out programming the on update event or just go forward with an ASPX page to reduce lag response.

miweiser
Newbie Poster
12 posts since Oct 2009
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: