Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

invalid reference to the property Visible 3

Status
Not open for further replies.

TwoOdd

Programmer
Sep 10, 2003
196
CL
This form works in Access 2002 but not 2003. I'm still trying to figure out what the form is trying to do, but it looks like it is trying to set the Visible property to No -- for what, I'm not exactly sure -- it gives me the following error in Access 2003:

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.

Is there a reference that I need to add for this to work in 2003? Or is it something else?

Any help would be appreciated.

Thanks,


TwoOdd
--------------
Good judgment comes from experience, and experience comes from bad judgment.
-- Barry LePatner
 
We must see the code to be able to have an opinion as to what is going on. Please post the code that is causing the problem.

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
It's a macro.

Action = SetValue
Item = [Visible]
Expression = No

TwoOdd
--------------
Good judgment comes from experience, and experience comes from bad judgment.
-- Barry LePatner
 
You displayed:

Code:
Action = SetValue
Item = [Visible]
Expression = No

I believe it should look like this to modify and set the .visible property of a forms control to NO:

Code:
Action = SetValue
Item = Forms![[i][red]yourformname[/red][/i]]![[i][red]control_name[/red][/i]].Visible 
Expression = No

The way it was coded previously the command couldn't function because the visible property wasn't tied to a control.

Let me know if this works for you.

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
You'll have to forgive me, but I'm trying to troubleshoot a form I didn't create, so I'm having difficulty trying to figure out exactly what it's trying to do.

I think it is trying to set the form property visible to no. In other words, the form is the control.

When I tried to reference the form in the macro, I get the following:
[red]
You don't have the license required to use this ActiveX control.
[/red]
The problem is that the form is a MS Office Access Class Object. I don't know how the form was created or where it exists, because it doesn't show up under the forms section. The only way to get to this particular form is to open the report that opens the form.

I'm sorry if this doesn't make any sense, I'm having a difficult time making sense of it myself.

TwoOdd
--------------
Good judgment comes from experience, and experience comes from bad judgment.
-- Barry LePatner
 
Check your form out for an ActiveX control of some kind. You probably have one installed that you have not registered under the A2003. Look under your old version and see what ActiveX controls are registered and see if they are all registered in your new version.

Let me know if this is the problem.

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
I had that same problem on the OK button on a few forms asking for report criteria. They worked fine on Every version of Access except 2003.

I deleted the macro and pointed the button's action instead to a single line of VBA:

Me.Visible = False

I left everything else alone 'cause I'm lazy. Fixed it every time. Now they all work in Access 2000, 2002 and 2003.

Presenting solutions as anecdotes,
a.
 
I agree with yerfdoga to avoid macros and use VBA in stead.

To find your form, you can probably enter Tools | Options - View tab, and check the "Hidden objects" check box. It should then probably be viewable in the form tab of the database window.

I've seen some information on different sites indicating that 2003 might be, well not exactly more demanding regarding how form/control references are used, but perhaps less accepting (or forgiving;-)) than previous versions. I can't verify any of this, but it's the impression I'm getting. I tend to use the same syntax of referencing that's used in the Microsoft documentation, help files etc, and don't experience any problems at all, but perhaps I'm just lucky;-)

For a rundown on the code version of what I believe you're attempting, somewhat down this thread thread181-698010 there's a sample.

Roy-Vidar
 
Bob -- Thanks for your patience and help.

yerfdoga -- Your solution worked like a charm.

RoyVidar -- Thanks for the Tools | Options help, now I can see the objects that looked like they were never there. I think your impression of Access 2003 is correct -- it is less forgiving in the code.

Stars to all!

TwoOdd
--------------
Good judgment comes from experience, and experience comes from bad judgment.
-- Barry LePatner
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top