View Full Version : Change Query via Runtime


aqif
07-19-2009, 10:40 PM
Hi

I used to change SQL of a particular query during runtime by using the following

CurrentDb.QueryDefs("Qry_temp").sql = "SELECT * FROM QryTemp_All Where ID=" & MyInput

I have used above method in many complex situation in an Access database. Since I have migrated to MS Access Database Project (linked with SQL Server db) these statements are giving me error. What will be an equivalent way to change SQL of a query dynamically in an Access Database Project file?

Also, do any of you know a good step by step example of creating an ADP file?

Thanks

SQL_Hell
07-20-2009, 01:18 AM
Hi,

When you migrated, did you convert the existing access queries into views and stored procedures?

What is acually changing with the sql of this query?

aqif
07-24-2009, 12:16 AM
Well I just want to change the WHERE clause based on whatever user selects.