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 / Forms Programming / November 2005

Tip: Looking for answers? Try searching our database.

Simple Forms Collection Question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bernadou - 23 Nov 2005 12:36 GMT
I'm tying to get a handle on the forms collection.  If I have 5 forms in my
application, why don't I get a message box for each of the forms in my
application using the code below?  Currently, I'm only gettng the name of the
form where this handler exists and none of the other forms in the application.

Private Sub Detail_Click()

Dim Objform As Form
    For Each Objform In Application.Forms
    MsgBox (ObjForm.Name)
Next

End Sub

Thanks!
Bernie
Rick Brandt - 23 Nov 2005 12:54 GMT
> I'm tying to get a handle on the forms collection.  If I have 5 forms
> in my application, why don't I get a message box for each of the
[quoted text clipped - 10 lines]
>
> End Sub

The Forms collection only includes "open" forms.  Similar is true of the Reports
collection.

Signature

I don't check the Email account attached
to this message.     Send instead to...
RBrandt    at       Hunter      dot      com

bernadou - 24 Nov 2005 14:41 GMT
Ok, that helps a bunch, but, is there a way to iterate through all the forms
in an application without them being open?

Thanks
B

> > I'm tying to get a handle on the forms collection.  If I have 5 forms
> > in my application, why don't I get a message box for each of the
[quoted text clipped - 13 lines]
> The Forms collection only includes "open" forms.  Similar is true of the Reports
> collection.
Rick Brandt - 24 Nov 2005 14:53 GMT
> Ok, that helps a bunch, but, is there a way to iterate through all
> the forms in an application without them being open?

CurrentDB.Containers("Forms").Documents(n).Name

Will return the form name of each form if n is substituted with a value from
zero to the number of forms minus 1, but you cannot use that to get at all the
same properties that the Forms collection does.

Signature

I don't check the Email account attached
to this message.     Send instead to...
RBrandt    at       Hunter      dot      com

 
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.