Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 15th, 2006, 02:36 PM
Authorized User
 
Join Date: Feb 2006
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default Determining if form is closed

How to determine if form is closed , and how to determine if specific control has focus????

 
Old April 16th, 2006, 06:02 PM
Authorized User
 
Join Date: Jul 2004
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Function isopen(strname As String, Optional inttype As Integer = acForm)
'is the form open?
isopen = (SysCmd(acSysCmdGetObjectState, inttype, strname) <> 0)
End Function

 
Old April 17th, 2006, 02:09 AM
Friend of Wrox
 
Join Date: Jul 2005
Posts: 150
Thanks: 0
Thanked 0 Times in 0 Posts
Default

From the Northwind sample databse:

Function IsLoaded(ByVal strFormName As String) As Boolean
 ' Returns True if the specified form is open in Form view or Datasheet view.
    Dim oAccessObject As AccessObject

    Set oAccessObject = CurrentProject.AllForms(strFormName)
    If oAccessObject.IsLoaded Then
        If oAccessObject.CurrentView <> acCurViewDesign Then
            IsLoaded = True
        End If
    End If

End Function


Boyd
"Hi Tech Coach"
Access Based Accounting/Business Solutions developer.
http://www.officeprogramming.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Determining a database Schema rit01 Access 2 December 10th, 2005 03:54 PM
Determining the name of function dotnetprogrammer VS.NET 2002/2003 0 October 23rd, 2005 04:46 AM
Determining how a window is closed chrscote Javascript How-To 2 June 16th, 2005 07:53 AM
Determining the number of children raoulvb XSLT 2 November 30th, 2004 10:50 AM
capturing form closed events alexferrie C# 2 June 17th, 2003 10:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.