Passthrough not passing through


I want to ensure my processing is done one sql server as large table, I need to have a date range variable passed to the server to complete the select statement.

if i substitute the variable forms for real dates it works fine i just need to know how i can get the values in the two combox boxes to be put into the query.

please help as im guessing if i just design this as a regular query in access the whole delivery details table will be feteched and the processing done on the client
select patient_name, ship_to, Unit, Treatment, delivery_date, datename(day,delivery_date) as day, special_reason, Delivery_not_required, Quantity_required
From TBL_Delivery_details
Where (Delivery_date between ([forms!FRM_input for passthrough!combo3!]) And ([forms!FRM_input for passthrough!combo5]))
And Delivery_not_required = 0

Open in new window

LVL 25
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
I'm having a vague memory that with a pass-through query you can't do parameters like that, and that you have to feed it into a vba string...

Dim qd as QueryDef
Set qd = "your_query_name"
qd.SQL = "SELECT blah blah blah FROM blah WHERE some_field=" & Forms!some_form_some_column & " and banana_count=" & gBananaCount

Set qd = Nothing
'Then, just run the pass-through query.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
slam69Author Commented:
I did have a brief look at doing it that way but was hoping it might be easier in putting it in a pass through like this as im struggling with the connection string ;oS
slam69Author Commented:
all sorted now
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
>im struggling with the connection string ;oS
Give this a whirl...

Thanks for the grade.  Good luck with your project.  -Jim
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2005

From novice to tech pro — start learning today.