Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / December 2006

Tip: Looking for answers? Try searching our database.

Is form Loaded

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Daniel - 06 Dec 2006 13:35 GMT
Hello,

I have been using the following in my databases to determine if a form was
open or not

Function fIsLoaded(ByVal strFormName As String) As Integer
'Source: http://www.mvps.org/access/forms/frm0002.htm
'This Function Finds out if a form is open
'Returns a 0 if form is not open or a -1 if Open
   If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <> 0 Then
       If Forms(strFormName).CurrentView <> 0 Then
           fIsLoaded = True
       End If
   End If
End Function

However, going through the help file with access 2003, I came across the
.IsLoaded property.  Is one method better than the other for determining if a
form is open?  Is the .IsLoaded property new to access 2003?  Are there any
pros or cons to continuing to use the function?

Thank you for the clarifications,

Daniel
Allen Browne - 06 Dec 2006 14:28 GMT
The IsLoaded property of the form in the AllForms collection was new in
Access 2000. Feel free to use it in any recent version.

The code on the MVPs site is older code that is still useful if you need
compatibility with Access 97 or earlier.

Signature

Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> I have been using the following in my databases to determine if a form was
> open or not
[quoted text clipped - 20 lines]
>
> Daniel
Dirk Goldgar - 06 Dec 2006 21:16 GMT
> The IsLoaded property of the form in the AllForms collection was new
> in Access 2000. Feel free to use it in any recent version.
>
> The code on the MVPs site is older code that is still useful if you
> need compatibility with Access 97 or earlier.

Interestingly, the older, SysCmd version function is actually faster,
not that it matters in any practical application.  The nice, explicit
property exposed in the newer version is preferable for
self-documentation purposes.  I tend to use the oder version, though,
for maximum compatibility in an application I'm developing for multiple
clients.

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.