Re: "/decompile /recompile"
- From: "Allen Browne" <AllenBrowne@xxxxxxxxxxxxxx>
- Date: Mon, 23 Mar 2009 12:16:04 +0900
There's no recompile switch: You compile it again from the Debug in the code window.
Before you do that, make sure you compact again (to get completely rid of the decompiled stuff.)
Some of the other steps here might help:
Recovery sequence
at:
http://allenbrowne.com/recover.html
Step 2 will not apply if you are in A97.
If you are still stuck, you could try the SaveAsText/LoadFromText links at the end of that article.
Or, you may be able to copy the code out, set the form's HasModule to No, compact again, and then paste the code back in.
Or, the problem may be with the code itself. I'm not sure how successful the ctl.Undo will be in this context.
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Don L" <Don.Leverton@xxxxxxxxx> wrote in message
news:Y1Dxl.19161$PH1.155@xxxxxxxxxxx
Hi Folks,
STILL banging away with Access97 here... (more below) LOL
I'm "nearing completion" (yeah, right!) of my latest app ... and I've screwed something up.
Yes I have a backup ... from this morning.
I'm getting an "unexpected error 32811" while trying to run this code.
==========================================================
Private Sub cboShipVia_NotInList(NewData As String, Response As Integer)
CR = vbCrLf
'Notes:
'ALWAYS remember to set "Limit To List" to yes.
'Undo the combo-box before updating control value to "NewData"
Dim Result
' Return Control object that points to combo box.
Dim ctl As Control
Set ctl = Me!cboShipVia
' Exit this subroutine if the combo box was cleared.
If NewData = "" Then Exit Sub
NewData = StrConv((NewData), vbProperCase) ' Converts new entry to Proper Case.
' Ask the user if he or she wishes to add the new carrier.
Msg = ""
Msg = Msg & "'" & NewData & "' is not in the list." & CR & CR
Msg = Msg & "Do you want to add it?"
If MsgBox(Msg, vbQuestion + vbYesNo) = vbYes Then
ctl.Undo
----------------------------------------------------------- It's about here that everything broke.
Dim MyDB As Database
Set MyDB = CurrentDb
Dim rstShipVia As Recordset
Set rstShipVia = MyDB.OpenRecordset("tblShipVia", dbOpenDynaset)
With rstShipVia
.AddNew
!ShipVia = NewData
.Update
.Close
End With
Response = acDataErrAdded
' Set Response argument to indicate that data is being added.
Set MyDB = Nothing
Set rstShipVia = Nothing
Else
'Supress error message
Response = acDataErrContinue
ctl.Undo
Exit Sub
End If
End Sub
========================================================================================
I have nearly identical code elsewhere (in another combo-box on the same form) and it seemed to run just fine.
So ...
I did the "/repair/compact" thing ... and that didn't fix it.
I recalled another couple of "undocumented" switches (or thought I did) and know that you should only issue them in desperation.
"/decompile" seems to work, but wasn't there also a "/recompile"?
The "/decompile" seems to have worked ... as Access gets launched and there are a series of messages asking me if I want to save changes to various forms and modules.
However ... even after answering "Yes" to all of those changes ... the "unexpected error 32811" message pops up and the program closes after offering to send an error report to Micro$oft ... who suggests that I "upgrade" to Access 2007. LOL
Opening a code window and issuing the "recompile and save all modules" command results in the same thing. Corruption is the cause ... right?
My next step is to try to copy/paste all of the code into Notepad, then delete the whole form/subform.
I could then import my "old" form/subform from the backup and try pasting back in the code one procedure at a time.
Any other suggestions? I'd rather NOT lose the whole day's work.... :-(
Don
.
- References:
- "/decompile /recompile"
- From: Don L
- "/decompile /recompile"
- Prev by Date: More on the "/repair /compact" and "/decompile /recompile" switches
- Next by Date: Re: "/decompile /recompile"
- Previous by thread: Re: "/decompile /recompile"
- Next by thread: Re: "/decompile /recompile"
- Index(es):
Relevant Pages
|