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