Access开发培训
网站公告
·Access专家课堂QQ群号:151711184    ·Access快速开发平台下载地址及教程    ·欢迎加入Access专家课堂微信群!    ·如何快速搜索本站文章|示例|资料    
您的位置: 首页 > 技术文章 > 技术类

access页面设置模块代码分享

时 间:2009-01-15 08:20:20
作 者:UMVsoft整理   ID:1445  城市:上海
摘 要:Access页面设置模块代码分享
正 文:

Dim up, dn, le, ri, si, liAs Single , co As string'定义边距及页面函数


Sub ymszmk(strName As String) '页面设置模块On Error GoTo Err_ymszmkIf Nz(DCount("*", "REPORTLIP", "REPORT='" & strName & "'")) = 0 ThenMsgBox "没有此报表的页面设置,请设置", , "提示"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 "没有打印机,请先安装打印机!", , "提示"    Exit Sub    End If    MsgBox Err.Description    Resume Exit_Err_ymszmkEnd Sub 



Access软件网官方交流QQ群 (群号:54525238)       Access源码网店

常见问答:

技术分类:

相关资源:

专栏作家

关于我们 | 服务条款 | 在线投稿 | 友情链接 | 网站统计 | 网站帮助