Use Form for Report Criteria Macro Error in Access 2003

  • Thread starter Thread starter Erin
  • Start date Start date
E

Erin

I just upgraded to Access 2003. I have several reports
that use a form to supply criteria to parameter queries.
The macro for the OK button hides the form, leaving it
open, so the queries can access the information in the
form. I use the SetValue action, Visible item and No
expression. This macro has always worked in Access 2000 &
2002). But in Access 2003, it errors.
Specifically, "improperly references a property or method
of an object." OUCH! I HAVE to have this ability! I
thought it might have been a security issue & that I
hadn't yet downloaded Jet 4.0 SP8, but I have and I still
get the error. When I view the form's property sheet,
there is no property for Visible. I can't find visible in
the new (icky) help files for form properties...is this
property gone? How could it be? In the help article for
creating a form for parameters, it says to do exactly
this.
 
I just got a response to my questions, Stephanie. I sent
more info and when I hear anything back I will alert you.

Read the posting with the subject "Halt screen startling
inexperienced users" dated Jan 3.

Erin

-----Original Message-----
I am having the exact same problem and tried all of the
same solutions. Is this a bug? Have you gotten any other
answers on this one yet?
 
Stephanie, I got the following response and it worked for
me! Good luck.
Erin -

I found a post on another newsgroup that said the poster had contacted
Microsoft about this and had been told that there is a problem with the
Visible property of a form in a macro's SetValue action. I have not been
able to confirm this yet, but your info seems to match that of the other
poster's.

The workaround is to use VBA code to run that particular macro action. In
place of the SetValue action in your macro, put the RunCode action (we'll
set up a public function in a moment here) and tell the action that the
function argument is MakeFormInvisible() (included the () in the argument):
Action: RunCode
Function: MakeFormInvisible()

Then, go to the database window and click on Modules. Open a new module and
type the following into it:

Public Function MakeFormInvisible()
Forms!InputFormName.Form.Visible = False
End Function

(Replace InputFormName with the actual name of the form.)

Save the module and name it basFunctions.

This should now work for you. I'm still checking on this "bug" possibility.
-----Original Message-----
I am having the exact same problem and tried all of the
same solutions. Is this a bug? Have you gotten any other
answers on this one yet?
 
Back
Top