'Esto sirve para meter un report en vista previa, llamado 'desde un formulario MODAL. Si se hace sin mas, el Report 'se queda en segundo plano y no se ve. 'Bhuo Agosto 2002 'Uso: 'En vez de llamar al reporte de forma habitual, lo hacemos 'desde esta funcion. 'Es decir, desde cualquier formulario, que deseemos lanzar un 'reporte en vista previa, con formularios modales y para evitar que dicho 'reporte se quede 'detras' y no se vea, deberemos llamar asi: 'OpenReport("Mireporte", etc) 'Y la funcion OpenReport que hace todo esto es: Sub OpenReport(ReportName As String, Optional View As Integer, Optional _ FilterName As String, Optional WhereCondition As String) Dim loFormArray() As String Dim loform As Form Dim intCount As Integer Dim intX As Integer For Each loform In Forms If loform.Visible Then ReDim Preserve loFormArray(intCount) loFormArray(intCount) = loform.Name loform.Visible = False intCount = intCount + 1 End If Next DoCmd.OpenReport ReportName, View, FilterName, WhereCondition Do While IsVisible(acReport, ReportName): DoEvents: Loop For intX = intCount - 1 To 0 Step -1 Forms(loFormArray(intX)).Visible = True Next End Sub Function IsVisible(intObjType As Integer, strObjName As String) As Boolean Dim intObjState As Integer intObjState = SysCmd(acSysCmdGetObjectState, intObjType, strObjName) IsVisible = intObjState And acObjStateOpen End Function