M
MVP - WannaB
I have a form that will not open in normal or design mode and there are 2
Form_~TMPCLP######## objects in my VBA Project window, and there are 2
Objects with the same name in the MsysObjects table of type 32678 which means
they are forms. I expect that if I am able to delete these I might be able
to salvage my form.
However, Nothing I have tried allows me to delete anything from MsysObjects.
OH there is one other issue, Not able to run any code from the data base
with that form in it. I get a message that the module can't be found...
Nothign specific. So I have been working on something that I would run from
a different database file, like this. Can someone correct my mistake or tel
me where I've gone wrong ?
Thank you.
Function DeleteTemps()
Dim db As DAO.Database
Dim Rs As DAO.Recordset
Set db = OpenDatabase("PATH\FILENAME")
Set Rs = db.OpenRecordset("SELECT * FROM MSysObjects WHERE
(((MSysObjects.Name) Like ""~*"") AND ((MSysObjects.Type = -32768)))") ';,
DAO.dbOpenSnapshot)
Rs.MoveLast
Rs.MoveFirst
While Not Rs.EOF
Access.DoCmd.DeleteObject Access.AcObjectType.acForm, Rs.Fields(0).Value
Rs.MoveNext
Wend
Rs.Close
Set Rs = Nothing
Set db = Nothing
End Function
Form_~TMPCLP######## objects in my VBA Project window, and there are 2
Objects with the same name in the MsysObjects table of type 32678 which means
they are forms. I expect that if I am able to delete these I might be able
to salvage my form.
However, Nothing I have tried allows me to delete anything from MsysObjects.
OH there is one other issue, Not able to run any code from the data base
with that form in it. I get a message that the module can't be found...
Nothign specific. So I have been working on something that I would run from
a different database file, like this. Can someone correct my mistake or tel
me where I've gone wrong ?
Thank you.
Function DeleteTemps()
Dim db As DAO.Database
Dim Rs As DAO.Recordset
Set db = OpenDatabase("PATH\FILENAME")
Set Rs = db.OpenRecordset("SELECT * FROM MSysObjects WHERE
(((MSysObjects.Name) Like ""~*"") AND ((MSysObjects.Type = -32768)))") ';,
DAO.dbOpenSnapshot)
Rs.MoveLast
Rs.MoveFirst
While Not Rs.EOF
Access.DoCmd.DeleteObject Access.AcObjectType.acForm, Rs.Fields(0).Value
Rs.MoveNext
Wend
Rs.Close
Set Rs = Nothing
Set db = Nothing
End Function