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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Minimize forms using code 1

Status
Not open for further replies.

dvannoy

MIS
May 4, 2001
2,765
US
I have a form that could be opened up by multipule forms.
I tryed using the following code and I keep getting Type Mismatch...

Dim f As Form

For Each f In frmain
If TypeOf f Is Form Then
f.WindowState = 1
End If
Next

Thanks
 
The Forms collection is not a member of any individual form, but rather is a member of the Application. I would suggest trying the following:


Dim f As Form

For Each f In Forms
f.WindowState = 1
Next

This will minimize all forms, so you may want to place some conditional on that such as

if f.Name = &quot;<formname>&quot; then
f.windowstate = 1
endif

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top