D
Dan K
I redesigned an old database that someone put together a few years ago... I
copied a clever "switchboard" form w/ VB code that they had either written or
copied off of the net. I’m pretty good with Access Frontend processes but my
VB knowledge is almost nonexistent…
Everything was running fine until I had to add some additional macros
because of a design flaw. After this recent update, however, I’m getting a
strange error when I run a specific macro off of the switchboard.
The switchboard runs other macros fine and if I run this particular macro
manually I get no problems. But when I run the macro from the switchboard I
stumble upon an error handling message that the original designer put in
place, though once you OK passed the error box, the macro seems to run fine.
Here’s the message I’m seeing (message underlined):
HandleButtonClick_Err:
' If the action was cancelled by the user for
' some reason, don't display an error message.
' Instead, resume on the next line.
If (Err = conErrDoCmdCancelled) Then
Resume Next
Else
MsgBox "There was an error executing the command.", vbCritical
Resume HandleButtonClick_Exit
End If
End Function
In order to find the specific problem I added the following to the MsgBox
line:
MsgBox "There was an error executing the command.", vbCritical, , 16384
And now in place of the previous message box I get the following error:
“The expression On Click you entered as the event property setting produced
the following error: Invalid procedure call or argument.
• The expression may not result in the name of a macro, the name of a
user-defined function or [Event Procedure].
• There may have been an error evaluating the function, event, or macro
Show Help:
…
For help restoring missing references, see the Microsoft Knowledge Base
article 283806.
…â€
I checked out the MKB link but it doesn’t seem to have anything to do with
the error I’m seeing. I tried debugging the VB code and everything seems to
works fine. I’m a little stumped as to how to proceed.
Couple questions:
1) Was I right in adding the 16384 to the Msgbox function to get the error
detail?
2) Is this Invalid Procedure Call a problem in the VB code or the Macro
itself? Combo of both?
copied a clever "switchboard" form w/ VB code that they had either written or
copied off of the net. I’m pretty good with Access Frontend processes but my
VB knowledge is almost nonexistent…
Everything was running fine until I had to add some additional macros
because of a design flaw. After this recent update, however, I’m getting a
strange error when I run a specific macro off of the switchboard.
The switchboard runs other macros fine and if I run this particular macro
manually I get no problems. But when I run the macro from the switchboard I
stumble upon an error handling message that the original designer put in
place, though once you OK passed the error box, the macro seems to run fine.
Here’s the message I’m seeing (message underlined):
HandleButtonClick_Err:
' If the action was cancelled by the user for
' some reason, don't display an error message.
' Instead, resume on the next line.
If (Err = conErrDoCmdCancelled) Then
Resume Next
Else
MsgBox "There was an error executing the command.", vbCritical
Resume HandleButtonClick_Exit
End If
End Function
In order to find the specific problem I added the following to the MsgBox
line:
MsgBox "There was an error executing the command.", vbCritical, , 16384
And now in place of the previous message box I get the following error:
“The expression On Click you entered as the event property setting produced
the following error: Invalid procedure call or argument.
• The expression may not result in the name of a macro, the name of a
user-defined function or [Event Procedure].
• There may have been an error evaluating the function, event, or macro
Show Help:
…
For help restoring missing references, see the Microsoft Knowledge Base
article 283806.
…â€
I checked out the MKB link but it doesn’t seem to have anything to do with
the error I’m seeing. I tried debugging the VB code and everything seems to
works fine. I’m a little stumped as to how to proceed.
Couple questions:
1) Was I right in adding the 16384 to the Msgbox function to get the error
detail?
2) Is this Invalid Procedure Call a problem in the VB code or the Macro
itself? Combo of both?