query won't open in design mode in Access 2000

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

Guest

I have a query that won't open in design for me to edit it. It is the third
query in a set. 1st one opens fine ,2nd one is slower but 3rd just won't open
at all. Tables are all linked ok and it did used to work. Iv'e run a compact
repair database that hasn't helped at all.
Help
 
Try something like this:

Sub CopyQuery()
Dim Db AS DAO.Database
Dim BadQDef AS DAO.QueryDef, NewQdef As DAO.QueryDef
Set Db = Access.CurrentDb
Set BadQdef = Db.QueryDefs("TheBadQuery")
Set NewQdef=Db.CreateQueryDef("TheBadQueryCopy",BadQdef.SQL)
NewQDef.Close : Set NewQdef = Nothing
BadQdef.Close : Set BadQdef = Nothing
Db.Querydefs.refresh
Set Db = Nothing
End Sub

HTH

Pieter
 

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