"/decompile /recompile"
- From: "Don L" <Don.Leverton@xxxxxxxxx>
- Date: Mon, 23 Mar 2009 03:07:36 GMT
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
.
- Follow-Ups:
- Re: "/decompile /recompile"
- From: Don L
- Re: "/decompile /recompile"
- From: Don L
- Re: "/decompile /recompile"
- From: Allen Browne
- Re: "/decompile /recompile"
- From: Albert D. Kallal
- Re: "/decompile /recompile"
- Prev by Date: Re: Couting unique records in a report
- Next by Date: Re: "/decompile /recompile"
- Previous by thread: Re: Nice place for iPod lovers
- Next by thread: Re: "/decompile /recompile"
- Index(es):
Relevant Pages
|