I'm trying to run code behind a command button from a command button
on another form but get an error on this line. I figure I've got the
syntax wrong for calling this command button? Whats the right syntax
and/or can I call it directly without using the function.
Form1 has a command button that calls the function: Call
Send_Report_to_ RTF
The offending line is: Form_ReportChoi ces.CmdSave_to_ RTF_Click
Public Function Send_Report_to_ RTF()
Dim FormIsLoaded
FormIsLoaded = IsLoaded("Repor tChoices")
If FormIsLoaded = True Then
Form_ReportChoi ces.CmdSave_to_ RTF_Click
End If
End Function
Function IsLoaded(ByVal strFormName As String) As Integer
' Returns True if the specified form is loaded.
Const conDesignView = 0
Const conObjStateClos ed = 0
IsLoaded = False
If SysCmd(acSysCmd GetObjectState, acForm, strFormName) <>
conObjStateClos ed Then
If Forms(strFormNa me).CurrentView <> conDesignView Then
IsLoaded = True
End If
End If
End Function
TIA, Rick