I've never opened a form that way. What's wrong with:
DoCmd.OpenForm "MyFormName"
To open hidden try:
DoCmd.OpenForm "MyFormName", , , , , acHidden

Signature
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
If all I wanted to do was open a form, I would do it using a simple
DoCmd.OpenForm statement. What I'm trying to do here is reference a public
variable on another form. When I do this, using the syntax provided, it is
supposed to automatically open the form containing the public variable.
Access does open the form hidden, but when I try to make it visible (as
mentioned in my first post) the .Visible statement blows up. My textbook
says that shouldn't happen. Wondered if anyone might know anything about
this.
> I've never opened a form that way. What's wrong with:
>
[quoted text clipped - 17 lines]
>>
>> Is the text wrong? Am I doing something wrong?
Arvin Meyer [MVP] - 28 Jun 2007 15:36 GMT
You can use the OpenArgs argument for the public variable. OpenArgs is a
string, so:
DoCmd.OpenForm "MyFormName", , , , , acHidden, "Arvin"
will pass my name to the MyFormName form when it opens.

Signature
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
> If all I wanted to do was open a form, I would do it using a simple
> DoCmd.OpenForm statement. What I'm trying to do here is reference a public
[quoted text clipped - 27 lines]
>>>
>>> Is the text wrong? Am I doing something wrong?