Prev: Need Help...
Next: App in 2003 in a 2000 environment
From: MVP - WannaB on 11 May 2010 10:33 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... Nothing 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 tell 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
From: Douglas J. Steele on 11 May 2010 13:01 I seem to recall you posted this earlier, and received a recommendation to import everything into a new database. Did you try that? Give up trying to delete from MSysObjects: it's definitely not recommended! Another thing you could try is to make a copy of your database and do a compact/repair. -- Doug Steele, Microsoft Access MVP http://www.AccessMVP.com/DJSteele (no e-mails, please!) "MVP - WannaB" <MVPWannaB(a)discussions.microsoft.com> wrote in message news:5FCBA6C0-1FE9-4A8E-991C-CA3727A015D4(a)microsoft.com... >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... > Nothing 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 > tell > 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
From: MVP - WannaB on 11 May 2010 15:56 Yes, I did post this under a different subject line because I did not remember if I entered a subject line, and the searches from IE would not show anything resembling my question, so I thought it had not been accepted. I only now began to look at all messages and found both. Thank you, I have been moving all that I changed into a previously backed-up copy. Also the “Notify me of replies” did not work. That's enough complaining for now. I don't really need an answer to this, but I am stumped as to why that form went corrupt. It's a pretty simple unbound form that I was in the process of developing and testing on my local drive. The form will be used to provide users with a list of reports to select from and then based on the report selected provide a selection of parameters for them to use if they want. Thank you "Douglas J. Steele" wrote: > I seem to recall you posted this earlier, and received a recommendation to > import everything into a new database. Did you try that? > > Give up trying to delete from MSysObjects: it's definitely not recommended! > > Another thing you could try is to make a copy of your database and do a > compact/repair. > > -- > Doug Steele, Microsoft Access MVP > http://www.AccessMVP.com/DJSteele > (no e-mails, please!) > > "MVP - WannaB" <MVPWannaB(a)discussions.microsoft.com> wrote in message > news:5FCBA6C0-1FE9-4A8E-991C-CA3727A015D4(a)microsoft.com... > >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... > > Nothing 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 > > tell > > 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 > > > . >
|
Pages: 1 Prev: Need Help... Next: App in 2003 in a 2000 environment |