Boy, ol' 123, you really had me going there for awhile. Try as I might, I couldn't get yer darn error to show up. I did ev-ry-thang, and no error nowhere. I looked at all your various events from the Properties window in form design, checked the macros, etc.......
Well. Gram. Shame on you.
Not for copying the form from one db to another, because any old person can (and should, when the forms are well built) do that. But because you still have old, irrelevant,
unused (that's the worst adjective I can think of) code attached to the form, which you're not using, but which contains a mighty mistake.
Do this. Open the master form (Data Entry--no comment on that form name (ahem.)). Click the 'code' button (the funky triangle with red, green, and blue points, fyi). You will then see this, because I'm just copying it here:
Code:
Option Compare Database
Option Explicit
Private Sub Back_Click()
On Error GoTo Err_Back_Click
DoCmd.Close
Exit_Back_Click:
Exit Sub
Err_Back_Click:
MsgBox Err.Description
Resume Exit_Back_Click
End Sub
Private Sub Back_Click()
On Error GoTo Err_Back_Click
DoCmd.Close
Exit_Back_Click:
Exit Sub
Err_Back_Click:
MsgBox Err.Description
Resume Exit_Back_Click
End Sub
etc. etc. What you should see, if you don't already, is this: you have two procedures (as introduced by the word "sub", short for subroutine, means a procedure, normally tied to an event or called by another subroutine; might also be a "function", but hey, that's another story) with
exactly the same name. So, that error message was not lying (man, you had me looking in the MSKB...)--you have, in fact, an ambiguous procedure name, because you have two subroutines, both called "Back_Click". What's more, it's just exactly the same thing, twice; you would only need one,
if you were even using code! Which you're not.
So, you need to get rid of one copy of the procedure. Delete at least this much
Code:
Private Sub Back_Click()
On Error GoTo Err_Back_Click
DoCmd.Close
Exit_Back_Click:
Exit Sub
Err_Back_Click:
MsgBox Err.Description
Resume Exit_Back_Click
End Sub
from the code page.
Alternatively, since you are apparently using nothing but macros, go to the Properties dialog for the
form (you can close the code window), find the "has module" property, and switch it to "no". It will then prompt you saying hey are you sure you want to blow all this code away, and you may as well, because it doesn't even seem to correspond to any of your existing buttons and controls.
And then, you'll never see that error again. Oh, and do that in the other db, too, if you're not using code there. Or, at least get rid of the duplicate procedure.
No, but seriously: teaches me once again to look for the answer where MS says the answer will be. You just didn't understand the message--but
I did, and I was still diggin' around...
Nuff said. Good one, though. Good one.
