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_ReportChoices.CmdSave_to_RTF_Click
Public Function Send_Report_to_RTF()
Dim FormIsLoaded
FormIsLoaded = IsLoaded("ReportChoices")
If FormIsLoaded = True Then
Form_ReportChoices.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 conObjStateClosed = 0
IsLoaded = False
If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <>
conObjStateClosed Then
If Forms(strFormName).CurrentView <> conDesignView Then
IsLoaded = True
End If
End If
End Function
TIA, Rick