Dim up, dn, le, ri, si, liAs Single , co As string'定義邊距及頁(yè)面函數(shù) Sub ymszmk(strName As String) '頁(yè)面設(shè)置模塊On Error GoTo Err_ymszmkIf Nz(DCount("*", "REPORTLIP", "REPORT='" & strName & "'")) = 0 ThenMsgBox "沒(méi)有此報(bào)表的頁(yè)面設(shè)置,請(qǐng)?jiān)O(shè)置", , "提示"Exit SubEnd Ifup = DLookup("REUP", "REPORTLIP", "REPORT='" & strName & "'")dn = DLookup("REDOWN", "REPORTLIP", "REPORT='" & strName & "'")le = DLookup("RELEFT", "REPORTLIP", "REPORT='" & strName & "'")ri = DLookup("RERIGHT", "REPORTLIP", "REPORT='" & strName & "'")li = DLookup("RECOL", "REPORTLIP", "REPORT='" & strName & "'")si = DLookup("RESIZE", "REPORTLIP", "REPORT='" & strName & "'")co = IIf(DLookup("RECOURES", "REPORTLIP", "REPORT='" & strName & "'") Like "橫向", acPRORLandscape, acPRORPortrait)Dim prt As Printer Set prt = Application.Printers(0) prt.TopMargin = up * 56.7 '上prt.BottomMargin = dn * 56.7 '下prt.LeftMargin = le * 56.7 '左prt.RightMargin = ri * 56.7 '右prt.ItemsAcross = li '列prt.PaperSize = si '大小prt.Orientation = co DoCmd.OpenReport strName, acPreviewReports(strName).Printer = prt Exit_Err_ymszmk: Exit Sub Err_ymszmk: If Err = 5 Then MsgBox "沒(méi)有打印機(jī),請(qǐng)先安裝打印機(jī)!", , "提示" Exit Sub End If MsgBox Err.Description Resume Exit_Err_ymszmkEnd Sub |
|站長(zhǎng)郵箱|小黑屋|手機(jī)版|Office中國(guó)/Access中國(guó)
( 粵ICP備10043721號(hào)-1 )
GMT+8, 2025-7-17 00:38 , Processed in 0.062806 second(s), 16 queries .
Powered by Discuz! X3.3
© 2001-2017 Comsenz Inc.