setvalue

D

Dagster

I have an old database with a form to set report criteria. It works fine in
Access 2002 and 97. I have recently upgraded to Access 2003 and the macro is
failing on the "SetValue" Action. The Active Arguments in 97 and 2002 were
Item: [Visible]
Expression: No

When I run in 2003, I get an error which halts the macro and the form is not
closed as it does in 2002. I have modified the Item to [Forms]![Report
Criteria].[Visible] though I then get an error indicating I cannot access the
ActiveX Control?? Any helpers?
 
D

Dagster

Thanks Ken, You have led me straight to the bug. I have followed the work
around to the letter of Article ID : 841916 and created a vb module:

Public Function SetVisible(frmTarget As Object, fValue As Boolean)
frmTarget.Visible = fValue
End Function

Have then created a macro to call with a RunCode Action and an Argument of:
SetVisible (Forms!Report Criteria, False)
again as per Article ID : 841916. When I run the macro, it produces an error
"The Expression You Entered Contains Invalid Syntax"

The SetVisible function is detectable in the Argument Expression Builder, so
I am now quite confused. Any ideas?

I basically want to close my "Report Criteria" Form and continue with my
report generation.
cheers
Dagster

Ken Snell said:
This is a bug in ACCESS 2003. See this Microsoft Knowledge Base article for
more information and how to work around it:

Microsoft Knowledge Base Artilce 841916
You may receive an error message when you run a macro that uses the SetValue
action to set the Visible property of an object in Access 2003
http://support.microsoft.com/default.aspx?scid=kb;en-us;841916


--

Ken Snell
<MS ACCESS MVP>

Dagster said:
I have an old database with a form to set report criteria. It works fine
in
Access 2002 and 97. I have recently upgraded to Access 2003 and the macro
is
failing on the "SetValue" Action. The Active Arguments in 97 and 2002
were
Item: [Visible]
Expression: No

When I run in 2003, I get an error which halts the macro and the form is
not
closed as it does in 2002. I have modified the Item to [Forms]![Report
Criteria].[Visible] though I then get an error indicating I cannot access
the
ActiveX Control?? Any helpers?
 
K

Ken Snell [MVP]

You need [ ] around the name of the form because it contains spaces:

SetVisible (Forms![Report Criteria], False)


--

Ken Snell
<MS ACCESS MVP>

Dagster said:
Thanks Ken, You have led me straight to the bug. I have followed the
work
around to the letter of Article ID : 841916 and created a vb module:

Public Function SetVisible(frmTarget As Object, fValue As Boolean)
frmTarget.Visible = fValue
End Function

Have then created a macro to call with a RunCode Action and an Argument
of:
SetVisible (Forms!Report Criteria, False)
again as per Article ID : 841916. When I run the macro, it produces an
error
"The Expression You Entered Contains Invalid Syntax"

The SetVisible function is detectable in the Argument Expression Builder,
so
I am now quite confused. Any ideas?

I basically want to close my "Report Criteria" Form and continue with my
report generation.
cheers
Dagster

Ken Snell said:
This is a bug in ACCESS 2003. See this Microsoft Knowledge Base article
for
more information and how to work around it:

Microsoft Knowledge Base Artilce 841916
You may receive an error message when you run a macro that uses the
SetValue
action to set the Visible property of an object in Access 2003
http://support.microsoft.com/default.aspx?scid=kb;en-us;841916


--

Ken Snell
<MS ACCESS MVP>

Dagster said:
I have an old database with a form to set report criteria. It works
fine
in
Access 2002 and 97. I have recently upgraded to Access 2003 and the
macro
is
failing on the "SetValue" Action. The Active Arguments in 97 and 2002
were
Item: [Visible]
Expression: No

When I run in 2003, I get an error which halts the macro and the form
is
not
closed as it does in 2002. I have modified the Item to [Forms]![Report
Criteria].[Visible] though I then get an error indicating I cannot
access
the
ActiveX Control?? Any helpers?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top