Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
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 June 26th, 2003, 10:49 AM
Registered User
 
Join Date: Jun 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to know a fom is open or not?

Sorry, I am beginner in VBA..

I wish to know a form is open or not in VBA code. Can anyone just teach me how wirte the vba code in Access form. Thanks a lot...

I know it's stupid question, but help me....

Best Regards,
Gino Liu at CI.
 
Old June 26th, 2003, 10:58 AM
Authorized User
 
Join Date: Jun 2003
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here is the function I use.

Function MTSBuildSmart_IsLoaded(ByVal strFormName As String) As Boolean
On Error GoTo errHandler

    'Returns True if the specified form is open in either Form or Datasheet view.
    Const conObjStateClosed As Integer = 0
    Const conDesignView As Integer = 0

    If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <> conObjStateClosed Then
        If Forms(strFormName).CurrentView <> conDesignView Then
            MTSBuildSmart_IsLoaded = True
        End If
    End If

exitProc:
    Exit Function

errHandler:
    MsgBox (Err.Number & ", " & Err.Description)
    Resume exitProc

End Function

Regards,
Mike
 
Old June 26th, 2003, 01:09 PM
Registered User
 
Join Date: Jun 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, it's workable. You give me a big <H2>help</H2>...
:)

Best Regards,
Gino Liu at CI.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing DLL fom Report Rendering(SQL Server Repor) Somesh Reporting Services 0 December 31st, 2007 07:26 AM
Open document, Open second doc and copy to first justabeginner Word VBA 1 March 7th, 2007 02:47 AM
Open the "Open File" dialogue box piratelordx Access VBA 4 March 14th, 2006 10:08 PM
How do i export data fom local database to server gnel2000 SQL Server ASP 1 February 24th, 2005 12:08 AM
Attempted to open a database that is already open person747 Access 10 September 3rd, 2004 04:31 PM





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