pass-through-queries

  • Thread starter Thread starter Jason
  • Start date Start date
J

Jason

Hi,

Can someone help me on my way to use dynamic parameters in a
pass-through-query in access.

I've some forms which are referenced in jet queries and need to be
referenced in pass-through-queries. I tried to use the same approach with
queries, but it didn't worked.

If someone knows an anwser to this, i'd be very glad.

Thnx
 
Hi,

Can someone help me on my way to use dynamic parameters in a
pass-through-query in access.

I've some forms which are referenced in jet queries and need to be
referenced in pass-through-queries. I tried to use the same approach with
queries, but it didn't worked.

If someone knows an anwser to this, i'd be very glad.
Do you want us to write a help File on pass-through-queries for you?

give an example then we can show you (hopefully) where the problem is


If you expect an answer to a personal mail, add the word "manfred" to the first 10 lines in the message
MW
 
You have to dynamically modify the SQL.

For instance, if you want to pick up the value that's contained in
txtSurname on your form for use in your pass-through query, you'd need to
add code along the following lines:

Dim qdfCurr As DAO.QueryDef
Dim strSQL as String

strSQL = "SELECT Field1, Field2 FROM MyTable " & _
"WHERE Surname = '" & Me.txtSurname & "'"

Set qdfCurr = CurrentDb().Queries("MyPassThroughQuery")
qdfCurr.SQL = strSQL
 
Hello Douglas,

I've a similar question. How about passing the variable to a stored
procedure?
 
Ezekiël said:
Hello Douglas,

I've a similar question. How about passing the variable to a stored
procedure?

Same thing. You create (in code) the SQL statement that would constitute a
valid call to the Stored Procedure including the values to be passed as
parameters. Then you stuff that into the SQL property of a stored QueryDef and
execute it.
 
Back
Top