Criquio,
Tenho um botão com o codigo abaixo e não consegui inserir sua instrução:
Private Sub Command4_Click()
Dim stDocName As String
Dim accobj As AccessObject
On Error GoTo Err_Command4_Click
stDocName = "RlpGeral01"
'This function closes the report if the report is open and then re-opens the report.
Set accobj = Application.CurrentProject.AllReports.Item(stDocName)
If accobj.IsLoaded Then
If accobj.CurrentView = acCurViewPreview Then
DoCmd.Close acReport, stDocName
DoCmd.OpenReport stDocName, acPreview
End If
Else
DoCmd.OpenReport stDocName, acPreview
' Form.Visible = False
DoCmd.Close acForm, "FrmRelatorioGeral"
DoCmd.Minimize
End If
Exit_Command4_Click:
Exit Sub
Err_Command4_Click:
MsgBox Err.Description
Resume Exit_Command4_Click
End Sub