Exit_ButtonP_Click:
Exit Sub
Err_ButtonP_Click:
Dim r As String, k As String, Message3 As String
r = "The following unexpected error occurred in Sub ButtonP_Click,
CBF on " & ThisForm & "."
k = CRLF & CRLF & str$(Err) & ": " & Quote & Error$ & Quote
Message3 = r & k
MsgBox Message3, vbExclamation, "Unexpected Error - " & MyApp$ &
", rev. " & MY_VERSION$
Resume Exit_ButtonP_Click
End Sub
I have a problem with ButtonP on frmAdministrativeActivities. The
above code is what's run OnClick. There's no problem with the
MouseDown code. It runs fine. Of course, all the code compiles.
But OnClick of ButtonP, I get the unnumbered error. Strange is
that even when I delete ALL the ButtonP click code - the error
still persists on click of ButtonP. Ideas?
However, if the error persists even when *all* this code is removed, the
database has a corruption of the type that should be fixed by a decompile.
Suggested sequence:
1. Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html
2. Compact the database to get rid of this junk:
Tools | Database Utilities | Compact
3. Close Access. Make a backup copy of the file. Decompile the database by
entering something like this at the command prompt while Access is not
running. It is all one line, and include the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"
4. Open Access, and compact again.
--
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.
"MLH" <CR...@NorthState.net> wrote in message
news:do1332lbjqiq98kb0...@4ax.com...
I'm thinking of exporting the entire database to text & rebuilding it
from the raw text files. I'd rather do only the problematic form. Can
I do that?
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
It rebuilt frmAdministrativeActivities in the Forms tab
of the database window as "1234567890". Opening
that form and clicking ButtonP - identical same error.
Reducing the code behind ButtonP to this:
Private Sub ButtonP_Click()
End Sub
... I still get the same error message clicking on it.
Which is... "An unexpected error has occurred."
And finally, deleting the final 2 lines, removing all
the OnClick code for ButtonP - the same error occurs
when clicking the button. Hmmm???
Then decompile the new database, since importing the modules can import the
corruption. Create the form from scratch. Then paste in the code from
notepad if you wish.
--
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.
"MLH" <CR...@NorthState.net> wrote in message
news:sm3432l2qhsqhfe30...@4ax.com...
> Suggested sequence:
>
> 1. Uncheck the boxes under:
> Tools | Options | General | Name AutoCorrect
> Explanation of why:
> http://allenbrowne.com/bug-03.html
>
> 2. Compact the database to get rid of this junk:
> Tools | Database Utilities | Compact
>
> 3. Close Access. Make a backup copy of the file. Decompile the
> database by entering something like this at the command prompt
> while Access is not running. It is all one line, and include the
> quotes:
> "c:\Program Files\Microsoft office\office\msaccess.exe"
> /decompile
> "c:\MyPath\MyDatabase.mdb"
3b. Close the instance of Access that you used to decompile.
> 4. Open Access, and compact again.
5. open up the VBE and compile the Access project.
6. compact again.
--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
> If the decompile fails, it is time to create a new (blank)
> database, turn Name AutoCorrect off, and import all the *other*
> objects.
If I'm remembering correctly, MLH uses Access97, so Name AutoCorrect
wouldn't actually be relevant (if that's still true).
>If the decompile fails, it is time to create a new (blank) database, turn
>Name AutoCorrect off, and import all the *other* objects.
>
>Then decompile the new database, since importing the modules can import the
>corruption. Create the form from scratch. Then paste in the code from
>notepad if you wish.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Am running A97. Don't have Name AutoCorrect.
Glad. Here's what I did.
I restarted Access. Created a new database (db2). I imported the form
using Application.LoadFromText acForm, "1234567890",
"c:\temp\frmAdministrativeActivities.txt" Then I removed all code
from ButtonP (OnClick and MouseDown). Clicking ButtonP - same
error.
So, I created a new form - blank. I opened 1234567890 in design view,
selected ButtonP, pressed CTRL-c, pasted it into the new form
(remember, it has NO code now). Saved new form as Form1. Opened
it. Clicked ButtonP. Same error. Opened Form1 in design view, added
a new button - no code. Saved it. Opened it. Clicked new button. No
error.
So. Error is specific to the command button. I've never seen this
before. I went back to the original database. I copied the ButtonP
click 'n mousedown code to notepad. I deleted ButtonP. I clicked
on ButtonO in design view, pressed CTRL-c, CTRL-v, renamed the
new command bttn to ButtonP, pasted in the code from notepad.
It worked. No error.
--
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.
"MLH" <CR...@NorthState.net> wrote in message
news:t6q432p0r1a6hup80...@4ax.com...
I am just now discovering that ALL my work in
all my databases having any modules with XML
calls has been HIDDEN. I cannot SEE the code.
I know its there, though. That's what's causing
the error I'm getting. I went back to apps I'd written
last June - none of the XML procedures appear
completely. The comments display. The error trapping
displays. The generic DIM stmts 'n such display. But
the real meat of the code is hidden somehow. Its
still there and trying to run - but I cannot see nor
modify it. How could MicroSoft bypass all my security
and modify my code w/o permission like that?
SP2 changed my PC somehow - I cannot launch
links in emails now by clicking on them. I have to
copy them and paste them DIRECTLY into IE for
them to work. I lost the ability to open a 2nd instance
of IE by holding down the SHIFT key and clicking
on a link in active IE window.
Even stranger, apps I've rolled out onto customer
sites with A97 runtime since installing SP2 are WORKING. The XML
calls are functioning. But I cannot see nor modify my code
here - and it is not working for me.
The stuff that is happening outside of Access (such as how IE or OE work)
would be due to other security settings that have been changed with the
update, but the disappearing VBA code makes no sense to me.
--
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.
"MLH" <CR...@NorthState.net> wrote in message
news:rm1532l824q65fn59...@4ax.com...