Copying a query object in VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I would like to copy querydef in VBA. Can this be done? Example:
qryMyQuery to qryMyCopiedQuery

Thank you!
 
Hello,

I would like to copy querydef in VBA. Can this be done? Example:
qryMyQuery to qryMyCopiedQuery

Thank you!

I'm not sure why you would want to, but this should do it.

CurrentDb.CreateQueryDef "qryMyCopiedQuery", _
CurrentDb.QueryDefs ("qryMyQuery").SQL


- Jim
 
Back
Top