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

isloaded method 1

Status
Not open for further replies.

Machiaveli

Programmer
Dec 16, 2003
91
NL
Hello,

I wonder if somebody has a example of a isloaded code. I have a form that i use when clicking from another form. When adding a record and close the form, i use a requery method to refresh the first form. Now here's the problem, when i use the second form directly and adding some records, i get an error that it cannot find the 'first form'. I definitly think i need a isloaded code but i don't know how to use it.

Can someone help me?
 
Hi Machiaveli,

If you have A2K, you can use IsLoaded directly ..

[blue]
Code:
CurrentProject.AllForms!
Code:
YourForm
Code:
.IsLoaded
[/blue] (True/False)

In A97, you need to code the function yourself, but there is some help about it. Here is a cut and paste of it from the NorthWind Database:

[blue]
Code:
Function IsLoaded(ByVal strFormName As String) As Boolean
 ' Returns True if the specified form is open in Form view or Datasheet view.
    
    Const conObjStateClosed = 0
    Const conDesignView = 0
    
    If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <> conObjStateClosed Then
        If Forms(strFormName).CurrentView <> conDesignView Then
            IsLoaded = True
        End If
    End If
    
End Function
[/blue]

Enjoy,
Tony

------------------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading FAQ222-2244 before you ask a question.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top