Add Microsoft DAO 3.6 object librery...from Tools > Referance
Sub Create_Query()
Dim strsql As String
Dim myquery As DAO.QueryDef
Dim myquery As DAO.QueryDef
Set myquery = CurrentDb.CreateQueryDef("Mytable")
strsql = "Select * from [TableNme] where [Fieldname]=""Criteria"""
myquery.SQL = strsql
myquery.Close
myquery.Close
DoCmd.OpenQuery "Mytable"
End Sub
Explore and discover exciting holidays and getaways with Yahoo! India Travel Click here!
No comments:
Post a Comment