Access - Podesavanje Margina U Izvestajima Iz Vba Koda

  • December 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Access - Podesavanje Margina U Izvestajima Iz Vba Koda as PDF for free.

More details

  • Words: 286
  • Pages: 2
Access - Podešavanje margina u izveštajima iz VBA koda Access - Podešavanje margina u izveštajima iz VBA koda

16.04.2002

Pored toga što margine u Access izveštajima (Reports) možete podesiti u vreme dizajniranja, margine se mogu podesiti i u vreme izvršavanja Access aplikacija, i to putem programskog VBA koda. Sve što je potrebno da biste ugradili ovu opciju unutar vaših Access projekata jeste da sledeći programski kod smestite (prekopirate) u opšti (General) programski modul i pozovete datu funkciju u istom momentu kada pozivate i metod DoCmd.OpenReport. Funkcija će raditi u Access-u od verzije 95 pa naviše. Čak i u Access-u 2002 (XP) možete programskim kodom pristupiti podešavanjima margina preko atributa PrtMip, pa je tako ovaj programski kod kompatibilan i sa ovom verzijom. Type str_PRTMIP RGB As String * 28 End Type Type type_PRTMIP ' Varijable definisane kao Long tip zbog konverzije xLeftMargin As Long yTopMargin As Long xRightMargin As Long yBottomMargin As Long fDataOnly As Long xItemSizeWidth As Long yItemSizeHeight As Long fDefaultSize As Long xItemsAcross As Long yColumnSpacing As Long xRowSpacing As Long rItemLayout As Long rFastPrinting As Long rDataSheetHeadings As Long End Type '------------------------Funkcija----------------------------Public Function SetReportMarginDefault(strReportName As String, left!, top!, right!, bottom!) Dim PrtMipString As str_PRTMIP Dim PM As type_PRTMIP Dim objRpt As Report Dim tempPrtMip As String DoCmd.Echo False DoCmd.OpenReport strReportName, acDesign Reports(strReportName).Painting = False Set objRpt = Reports(strReportName) PrtMipString.RGB = objRpt.prtmip LSet PM = PrtMipString 'Koristite 1440 za SAD (ince),a 567 za centimetre PM.xLeftMargin = left * 1440 PM.yTopMargin = top * 1440 PM.xRightMargin = right * 1440 PM.yBottomMargin = bottom * 1440

LSet PrtMipString = PM objRpt.prtmip = PrtMipString.RGB ' Fokusiranje na report DoCmd.SelectObject acReport, strReportName 'Snimanje izvestaja DoCmd.DoMenuItem 7, acFile, 4, , acMenuVer70 CloseRpt: DoCmd.Close acReport, strReportName DoCmd.Echo True End Function

Related Documents