vba coding a new query ?

  • Thread starter Thread starter tf
  • Start date Start date
T

tf

Hello

With vba, I create dynamically
a query using a string

like:
SQLstring = "select * from mytable where ... "

I ' d like to create the object in the database
from the code.

Do you know how to code that ?


Thanks
 
tf,

That would be a QueryDef. In VBA Help, check out the CreateQueryDef method.
When you use this method, you can optionally create a Temporary QueryDef by
not supplying a string value for Name, or you can pass a string value for
the Name of the QueryDef which will then save it as a query.

hth,
 
Back
Top