Ivair Martins 1/5/2012, 15:45
Bom dia
Então ficou assim
Em um módulo coloquei essas Funções
Option Compare Database
Option Explicit
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
.
Private Declare Function IsWindow Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function InvalidateRect Lib "user32" (ByVal hwnd As Long, _
lpRect As Long, ByVal bErase As Long) As Long
Private Declare Function UpdateWindow Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetDesktopWindow Lib "user32" () As Long
----------------------------------------------
Public Function fncScreenUpdating(State As Boolean, Optional Window_hWnd As Long = 0)
Const WM_SETREDRAW = &HB
Const WM_PAINT = &HF
If Window_hWnd = 0 Then
Window_hWnd = GetDesktopWindow()
Else
If IsWindow(hwnd:=Window_hWnd) = False Then
Exit Function
End If
End If
If State = True Then
Call SendMessage(hwnd:=Window_hWnd, wMsg:=WM_SETREDRAW, wParam:=1, lParam:=0)
Call InvalidateRect(hwnd:=Window_hWnd, lpRect:=0, bErase:=True)
Call UpdateWindow(hwnd:=Window_hWnd)
Else
Call SendMessage(hwnd:=Window_hWnd, wMsg:=WM_SETREDRAW, wParam:=0, lParam:=0)
End If
End Function
----------------------------------------------------------------
Ai no Botao do meu form coloquei essa rotina.
Private sub Botao()
Dim strArquivo As String
Dim strLocal As String
strArquivo = "Pedido de Compra Nº- " & Form_PEDStatus1sub.PEDNO & ".pdf"
strLocal = CurrentProject.Path & "\Gerados\" & strArquivo
DoCmd.OpenReport "relatorioumped", acViewPreview, , "pedno = " & Form_PEDStatus1sub.PEDNO, acHidden
fncScreenUpdating State:=False
DoCmd.OutputTo acOutputReport, "relatorioumped", acFormatPDF, strLocal, False
fncScreenUpdating State:=True
DoCmd.Close acReport, "relatorioumped"
End sub
Obrigado...
Abraços...