Ms access 如何在MS Access中通过FileDialog保存时筛选报表对象
我试图使用FileDialog保存rtf文件,并希望使用where子句进行筛选。这就是我所拥有的:Ms access 如何在MS Access中通过FileDialog保存时筛选报表对象,ms-access,vba,report,filedialog,Ms Access,Vba,Report,Filedialog,我试图使用FileDialog保存rtf文件,并希望使用where子句进行筛选。这就是我所拥有的: Set dlgSave = FileDialog(msoFileDialogSaveAs) With dlgSave .Title = "Provide the place to save this file" .ButtonName = "Save As..." .InitialFileName = Me.cmbPickAReportToPrint.Value & "-" &
Set dlgSave = FileDialog(msoFileDialogSaveAs)
With dlgSave
.Title = "Provide the place to save this file"
.ButtonName = "Save As..."
.InitialFileName = Me.cmbPickAReportToPrint.Value & "-" & Format(Date, "mmddyy") & ".rtf"
.InitialView = msoFileDialogViewDetails
If .Show Then
DoCmd.OutputTo acOutputReport, Me.cmbPickAReportToPrint.Value, acFormatRTF, .SelectedItems(1)
End If
End With
关于如何在不改变报表的情况下添加where子句,有什么想法吗?我发现,在不涉及报表代码本身的情况下,最简单的方法是在应用过滤器的预览模式下打开报表,然后将报表输出为所需的任何格式
If .Show Then
DoCmd.OpenReport Me.cmbPickAReportToPrint.Value, acViewPreview, , "fieldToFilterOn = 'value'"
DoCmd.OutputTo acOutputReport, Me.cmbPickAReportToPrint.Value, acFormatRTF, .SelectedItems(1)
End If