manoj.mcans
Registered User.
- Local time
- Today, 01:47
- Joined
- Sep 1, 2008
- Messages
- 18
I want to run simple
Select * from Tablename using vba code not going in query design mode.
usually i use
first create simple query in query design mode with name abc
then in vba code
I have made the odbc connection in Ms-Acccess
Dim MyDB As DAO.Database
Dim qdef As DAO.QueryDef
Dim stDocName As String
Set MyDB = CurrentDb()
MyDB.QueryDefs.Delete "abc"
Set qdef = MyDB.CreateQueryDef("abc", "Select * from tablename")
stDocName = "abc"
DoCmd.OpenQuery stDocName, acNormal, acEdit
This code work fine but for this we have to create the query abc..but i didnot want to create
Please suggest me.
Select * from Tablename using vba code not going in query design mode.
usually i use
first create simple query in query design mode with name abc
then in vba code
I have made the odbc connection in Ms-Acccess
Dim MyDB As DAO.Database
Dim qdef As DAO.QueryDef
Dim stDocName As String
Set MyDB = CurrentDb()
MyDB.QueryDefs.Delete "abc"
Set qdef = MyDB.CreateQueryDef("abc", "Select * from tablename")
stDocName = "abc"
DoCmd.OpenQuery stDocName, acNormal, acEdit
This code work fine but for this we have to create the query abc..but i didnot want to create
Please suggest me.
