Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determine if Form is Visible

Status
Not open for further replies.

illini

Technical User
Aug 2, 2002
89
0
0
FR
I'm looking to find a faster way of running through all the forms within a dbs and determining if they are visible. Here's what I have...

Function Test_Forms()
For Each dbsForm In Access.Forms
On Error Resume Next
If dbsForm.Visible = True Then Call Run_Test
On Error GoTo 0
Next dbsForm
End Function


I have quite a few forms and this function takes too long.

-illini
 
Btw Visible is not the good property to look at (except if you really want to jump over form that are loaded but not visible)

try something like
[tt]
Dim counter As Integer
Dim formOpened as boolean
formOpened = false
For counter = 0 To counter = Application.Forms.Count 'Application.Forms.Count is the number of opened forms
'the current form is Application.Forms.Item(counter).Name
Call run_test 'or what you want
Next counter[/tt]

that way you only loop through the loaded form so that should be faster


jul ^_^
"Computer Science is no more about computers than astronomy is about telescopes"
E. W. Dijkstra.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top