By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,466 Members | 2,523 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,466 IT Pros & Developers. It's quick & easy.

Show window

P: n/a
Dear All,

What's the equivalent in VBA of clicking a formname in menu window to show a
form.
How can I check if the form is present in the window-menu.

Thanks,

Filip
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Filips Benoit wrote:
Dear All,

What's the equivalent in VBA of clicking a formname in menu window to show a
form.
How can I check if the form is present in the window-menu.


You can do a docmd.openform for a form that is already open; it will
bring it to front.

You cannot directly query the window menu, but there is a collection
Forms which contains only the open forms. Mind you, subforms are not
represented in this collection.

call my function with your form name, let's say it's called frmBasic:

if isOpen(acForm, "frmBasic") then
end if

Function isOpen(nType as integer, cName as string)as string
isOpen = (acObjStateOpen And SysCmd(acSysCmdGetObjectState, nType,
cName))'watch line wrap! this is one line!
End Function

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
I prefer human mail above automated so in my address
replace the queue with a tea
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.