Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Feb 2002
    Location
    Riverside, California, USA
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Which post was it (Access 2002)

    I'm looking for a post regarding finding out programmatically if a form is open or not. I believe I saw it here, but if not, my apologies.

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Which post was it (Access 2002)

    Don't know which post it is, but you can use this:

    Syscmd(acsyscmdGetObjectState, acform, "...your form name here...")

    This returns a 1 if form is opened, or 0 if it isn't.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Which post was it (Access 2002)

    You can wrap the code mentioned by Mark Liquorman in a function (to be placed in a general module):

    Function IsFormLoaded(ByVal strFormName As String) As Boolean
    If SysCmd(acSysCmdGetObjectState, acForm, strFormName) Then
    IsLoaded = Forms(strFormName).CurrentView
    End If
    End Function

    This function also checks the CurrentView property to avoid returning True if the form is open in design view.

    You can use the function in the form

    If IsFormLoaded("frmMyForm") Then ...

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Which post was it (Access 2002)

    If you're working in code, the AccessObject also has an IsLoaded property.
    Charlotte

  5. #5
    New Lounger
    Join Date
    Feb 2002
    Location
    Riverside, California, USA
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Which post was it (Access 2002)

    Thanks all. Your assistance was extremely useful and sent me off onto new horizons <img src=/S/exclamation.gif border=0 alt=exclamation width=15 height=15>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •