Create a query dynamically

后端 未结 3 474

Hi I need to create a query in MSAccess 2003 through code (a.k.a. VB) -- how can I accomplish this?

3条回答
  •  悲哀的现实
    2020-12-17 10:50

    A vague answer for a vague question :)

    strSQL="SELECT * FROM tblT WHERE ID =" & Forms!Form1!txtID 
    
    Set qdf=CurrentDB.CreateQueryDef("NewQuery",strSQL)
    DoCmd.OpenQuery qdf.Name
    

提交回复
热议问题