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

How to determine name of active form in VBA 1

Status
Not open for further replies.

Soundsmith

Programmer
Feb 21, 2001
84
US
How can I retrieve, in VBA code, the name or other ID of the active form (if any, there may also be no open forms)? David 'Dasher' Kempton
The Soundsmith
 
dim frm as form

frm = nz(screen.activeform)

if frm = "" then
msgbox "no open forms"
else
msgbox frm.Name
end if

I think it is something like this.

Nick
 
Hi,

What if the there are many forms, and I would like to know all of them?

Thanks.

Rey
 
Or how do I determine if a certain form is open?

Thanks again.

Rey
 
There is a function that comes with one of the default databases, possibly Northwind, called isLoaded. I always import this function into my apps as I find it really useful. You can then use it like:

if isloaded("form") then
doSomething
else
doSomethingElse
end if

Hope this is ok,

Nick
 
Nick,

Thanks alot, your help was very much appreciated!!

Rey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top