A
A Dodson
The following is how to work around the error in the documentation about "Creating a form to enter report criteria" since it no longer functions properly in Office 2003, Access Reference 11.0. In particular, step 4 about creating a macro for the OK button is flawed. I figured out the coding below that allowed it to work. However, in a nutshell, if you convert the macro to VB, it shows that the Me. is being left off of the Me.Visible = False. I'm not sure if "No" in the instructions also needs to be changed to False. Probably not, but I don't know how to test that.
Thank you.
__________________________________________________________________
The Macro is flawed. Instead of using the Ok function in the macro, go to your form, create code for the click of your button. It should go like this:
'ButtonTitle Click
Private Sub ButtonTitle_Click()
On Error GoTo ButtonTitle_Click_Error
With CodeContextObject
'ok button
Me.Visible = False
End With
ButtonTitle_Click_Exit:
Exit Sub
ButtonTitle_Click_Error:
MsgBox Error$
Resume ButtonTitle_Click_Exit
End Sub
The error between the Macro and the code I got to work is the Me.Visible = False. If you were to convert the Macro into VB, it leaves the "Me." off
As I don't really understanding programming, but can mimic relatively well, I was able to figure this out, but won't be able to explain any of it. I'm sorry.
BTW, this was for use with the Reference that comes with 2003, the Access Version 11.0. The 9.0 with 2000 didn't need the coding done instead of the macro.
Microsoft should fix their documentation and/or fix the macro.
Thank you.
__________________________________________________________________
The Macro is flawed. Instead of using the Ok function in the macro, go to your form, create code for the click of your button. It should go like this:
'ButtonTitle Click
Private Sub ButtonTitle_Click()
On Error GoTo ButtonTitle_Click_Error
With CodeContextObject
'ok button
Me.Visible = False
End With
ButtonTitle_Click_Exit:
Exit Sub
ButtonTitle_Click_Error:
MsgBox Error$
Resume ButtonTitle_Click_Exit
End Sub
The error between the Macro and the code I got to work is the Me.Visible = False. If you were to convert the Macro into VB, it leaves the "Me." off
As I don't really understanding programming, but can mimic relatively well, I was able to figure this out, but won't be able to explain any of it. I'm sorry.
BTW, this was for use with the Reference that comes with 2003, the Access Version 11.0. The 9.0 with 2000 didn't need the coding done instead of the macro.
Microsoft should fix their documentation and/or fix the macro.