CHAOSinACT
Registered User.
- Local time
- Today, 11:57
- Joined
- Mar 18, 2009
- Messages
- 235
ok, did some reading on loading forms in the acDialog setting. all SEEMED to make sense.
as i understand it, u call a form to dialog mode like this:
DoCmd.OpenForm "frmModClaimOrVariSelector", acNormal, , , , acDialog
and when the user his the ok button the form does a behind the scenes me!visible = false. allowing the code to continue to run until u unload the form.
been running tests with this:
Public Sub TestDialog()
DoCmd.OpenForm "frmModClaimOrVariSelector", acNormal, , , , acDialog
If IsLoaded("frmModClaimOrVariSelector") = True Then
MsgBox "Isloaded"
Else
MsgBox "NotLoaded"
End If
DoCmd.Close acForm, "frmModClaimOrVariSelector"
End Sub
which is supported by this:
Function IsLoaded(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
IsLoaded = True
End If
End If
End Function
oddly it fails the IsLoaded test everytime. Is my info out of date? does 2007 onwards dialog function differently? seems pretty simple but isn't working...
as i understand it, u call a form to dialog mode like this:
DoCmd.OpenForm "frmModClaimOrVariSelector", acNormal, , , , acDialog
and when the user his the ok button the form does a behind the scenes me!visible = false. allowing the code to continue to run until u unload the form.
been running tests with this:
Public Sub TestDialog()
DoCmd.OpenForm "frmModClaimOrVariSelector", acNormal, , , , acDialog
If IsLoaded("frmModClaimOrVariSelector") = True Then
MsgBox "Isloaded"
Else
MsgBox "NotLoaded"
End If
DoCmd.Close acForm, "frmModClaimOrVariSelector"
End Sub
which is supported by this:
Function IsLoaded(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
IsLoaded = True
End If
End If
End Function
oddly it fails the IsLoaded test everytime. Is my info out of date? does 2007 onwards dialog function differently? seems pretty simple but isn't working...