Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / June 2007

Tip: Looking for answers? Try searching our database.

Automatically opening a form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David Portwood - 27 Jun 2007 03:52 GMT
The Access 2K text I'm reading says the following should work:

Form_MyFormName.PublicVar = "New Caption"
Forms!MyFormName.visible = True

The text says that even if MyFormName is not loaded, this syntax will load
the form hidden and then make it visible.

Well, when the form is not open, it does automatically load the form hidden.
However, the second statement blows up. Error message says it can't find
"MyFormName". But it definitely is loaded hidden. I can unhide it manually.

Is the text wrong? Am I doing something wrong?
Arvin Meyer [MVP] - 27 Jun 2007 04:27 GMT
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

> The Access 2K text I'm reading says the following should work:
>
[quoted text clipped - 10 lines]
>
> Is the text wrong? Am I doing something wrong?
David Portwood - 28 Jun 2007 06:28 GMT
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?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.