How get text of a query in VB ?

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

Guest

I have a complex query that includes in the WHERE clause a NOT IN (n1,n2)
clause.
I need to run this query but with the 'NOT IN' replaced by 'IN'.
So, I'd like to grab the text of the query and do a REPLACE, then execute
it. How would I do this? Thanks.
 
Try something like

Application.CurrentDb.QueryDefs("QueryName").SQL =
Replace(Application.CurrentDb.QueryDefs("QueryName").SQL, "Not In", "In")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top