G
Guest
I converted an Access 97 mdb to Access 2003 and am getting undesirable
behavior when debugging. I have tried it on three different computers with
same result. I have a form with a single command button. and two procedures
as shown below:
Public Function TestProcedure()
Dim s As String
Dim dt As Date
s = "12/31/2005"
dt = s & "aaaa"
End Function
Private Sub Command0_Click()
Call TestProcedure
End Sub
IN the properties dialog for the button control, I can set the On Click
property to either (1) [Event Procedure] or (2) =TestProcedure()
The first method setting works fine. When I click the button I get a Dialog
that says Run-time error, Type mismatch with buttons for End, Debug, etc.
This is the behavior that I want.
When I use the second method, I do not get this dialog, instead I get a
Message box that says: "The expression ON Click you entered as the event
property setting produced the following error: Type mismatch." The statement
is correct but instead of giving me an option to debug, I only have two
buttons that have titles of "Show Help>>' and "OK". There is no debug button
and no way for me to go to find the bad line of code. In Access 97, you got
the same dialog regardless of the way you defined the On click event. Can
someone offer me a solution to this problem? I have all the latest updates.
behavior when debugging. I have tried it on three different computers with
same result. I have a form with a single command button. and two procedures
as shown below:
Public Function TestProcedure()
Dim s As String
Dim dt As Date
s = "12/31/2005"
dt = s & "aaaa"
End Function
Private Sub Command0_Click()
Call TestProcedure
End Sub
IN the properties dialog for the button control, I can set the On Click
property to either (1) [Event Procedure] or (2) =TestProcedure()
The first method setting works fine. When I click the button I get a Dialog
that says Run-time error, Type mismatch with buttons for End, Debug, etc.
This is the behavior that I want.
When I use the second method, I do not get this dialog, instead I get a
Message box that says: "The expression ON Click you entered as the event
property setting produced the following error: Type mismatch." The statement
is correct but instead of giving me an option to debug, I only have two
buttons that have titles of "Show Help>>' and "OK". There is no debug button
and no way for me to go to find the bad line of code. In Access 97, you got
the same dialog regardless of the way you defined the On click event. Can
someone offer me a solution to this problem? I have all the latest updates.