-
Notifications
You must be signed in to change notification settings - Fork 3
/
M_omReportFunctions.def
25 lines (20 loc) · 1.03 KB
/
M_omReportFunctions.def
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Option Compare Database
Option Explicit
Public Sub ExportToPDF(reportname As String, filename As String, Optional whereCondition As String, Optional windowMode As AcWindowMode = acWindowNormal, Optional outputQuality As AcExportQuality = AcExportQuality.acExportQualityPrint)
DoCmd.OpenReport reportname, acViewPreview, whereCondition:=whereCondition, windowMode:=IIf(windowMode = acDialog, acHidden, windowMode)
DoCmd.OutputTo acOutputReport, reportname, acFormatPDF, filename, outputQuality:=outputQuality
If windowMode = acHidden Or windowMode = acDialog Then
DoCmd.Close acReport, reportname, acSaveNo
If windowMode = acDialog Then
DoCmd.OpenReport reportname, acViewPreview, whereCondition:=whereCondition, windowMode:=windowMode
End If
End If
End Sub
Public Sub UpdateVisibleByTag(Report As Report, tag As String, state As Boolean)
Dim ctrl As Control
For Each ctrl In Report.Controls
If ctrl.tag = tag Then
ctrl.Visible = state
End If
Next
End Sub