keeping form open

outside1

New member
Local time
Today, 10:12
Joined
Jun 28, 2001
Messages
8
I am trying to keep open several different forms at the same time. Yet in using acDialog I am no able to access more then the last form opened. I need to be able to access more then one form and keep the code form moving on. Below is the code used to open the two forms. With the second form allowing me to access the remaining forms but all the data shows up behind the first. Any ideas ? ? ?

*****Form 1
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmJob_section"
stLinkCriteria = "[quote_id]=" & [New_quote_id]

DoCmd.OpenForm stDocName, , , stLinkCriteria, , acDialog

*****Form2
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmOutScopeofWork"
DoCmd.OpenForm stDocName, , , stLinkCriteria

I am sure is has something to do with acDialog, but I do not know what other options I have.

Thanks
 
Put this function in a module....

Function fIsLoaded(ByVal strFormName As String) As Integer
'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

That checks to see if a form is open... Then, all you have to do is open the forms normally(not acDialog) and use the following code after you open your two forms...

while fIsLoaded(stDocName) or fIsLoaded(stDocName2)
doevents
wend

This will pause execution while either form is open and you will freely be able to access either form. Hope this helps you.

Doug
 

Users who are viewing this thread

Back
Top Bottom