469,361 Members | 2,239 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,361 developers. It's quick & easy.

Change SQL from DAP

3
Hi, I'm doing a project to build a searchable Data Access Page. Since I need to search from different tables, I hope to link the page to a query and change SQL of the Query by clicking a command button in order to change source of the query.

What I can do now is to change SQL from module, the code is:

Expand|Select|Wrap|Line Numbers
  1. Function ChangeQueryDef(strQuery As String, strSQL As String) As Boolean
  2.     If strSQL = "" Or strQuery = "" Then Exit Function    
  3.     Dim qdf As QueryDef
  4.     Set qdf = CurrentDb.QueryDefs(strQuery)
  5.  
  6.     qdf.SQL = strSQL
  7.     qdf.Close
  8.     RefreshDatabaseWindow   
  9.     ChangeQueryDef = True    
  10. End Function
But the function is not applicable in DAP. How to change the code to VBScript version?

Thanks in advance!
Aug 16 '07 #1
0 823

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by J.C. Flores | last post: by
1 post views Thread by Spike | last post: by
5 posts views Thread by Hank | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.