CY Create a form to enter report criteria

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

I need to use forms to prompt my users for criteria.
I've used the instructions in Help building the necessary
form, macro, query, and report. The instructions include
linking a command button (OK) on the form to a macro
action SetValue with the Item set to [Visible] and
Expression set to "No". It works fine in Access XP.
It bombs in Access 2003. When I click the "OK" button on
the form, I get the following message.

"You entered an expression that has an invalid reference
to the property Visible. the property may not exist or
may not apply to the object you specified.

Why is this not working?

- Chris
 
I'm also having this problem when converting my dbs from 2000 to 2003. I've tried pulling it out and reinserting-same problem. I've also noticed that if you allow it to open the 2000 Access db in 2003 (without converting) it still has the problem. When I return to the computer with 2000 installed, it works fine.

Would greatly appreciate some help on this one. I'm thinking maybe there was some VB change behind it?
 
Thanks. It works perfectly. - chris

A Dodson said:
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.

Chris said:
I need to use forms to prompt my users for criteria.
I've used the instructions in Help building the necessary
form, macro, query, and report. The instructions include
linking a command button (OK) on the form to a macro
action SetValue with the Item set to [Visible] and
Expression set to "No". It works fine in Access XP.
It bombs in Access 2003. When I click the "OK" button on
the form, I get the following message.

"You entered an expression that has an invalid reference
to the property Visible. the property may not exist or
may not apply to the object you specified.

Why is this not working?

- Chris
 
Back
Top