sending parameters in pass through query 
Author Message
 sending parameters in pass through query

I need help with the syntax to assign to a command button on MS Access 2.0
form. I need the action to get the values of two fields (start date and end
date) on the form and pass them to a SQL Server 2000 database table as part
of an update.

thanks.

-SB



Thu, 15 Dec 2005 08:57:55 GMT  
 sending parameters in pass through query
The only way I'm aware of is to update the SQL of the pass-through query,
then run the query.

Pass-through queries can't use parameters, the way non pass-through queries
can.

Dim dbCurr As Database
Dim qdfCurr As QueryDef
Dim strSQL As String

' set strSQL to whatever, including the values of the 2 fields
   strSQL = '

   Set dbCurr = CurrentDb()
   Set qdfCurr = dbCurr.QueryDefs("MyPassthroughQuery")
   With qdfCurr
       .SQL = strSQL
       .Execute, dbFailOnError
   End With

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele


Quote:
> I need help with the syntax to assign to a command button on MS Access 2.0
> form. I need the action to get the values of two fields (start date and
end
> date) on the form and pass them to a SQL Server 2000 database table as
part
> of an update.

> thanks.

> -SB



Thu, 15 Dec 2005 19:47:52 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. passing parameter to a parameter query

2. Passing Parameters to stored parameter queries using VB 5's Data Controls

3. Passing Parameters into a Pass-Through Query

4. Passing parameters to SQLServer using a Pass-Through query

5. calling parameter query from a parameter query

6. Pass Access Query Parameters from Excel

7. Passing multiple parameters to Access query using Form List Box

8. pass a parameter to a query programmatically

9. Passing Query Parameter In VBA

10. How do I pass data to parameter query

11. Passing two parameters tp a query in VBA

12. Passing parameter to reports query

 

 
Powered by phpBB® Forum Software