access報(bào)表打印如何自動(dòng)分頁(yè)

字號(hào):


    問(wèn)題:
    每頁(yè)打印一定行數(shù)后自動(dòng)分頁(yè)
    方法一:
    加一個(gè)分頁(yè)符,在報(bào)表的代碼界面里面寫(xiě)入以下代碼:
    optioncomparedatabase
    dimrowaslong
    dimrowsinpageasinteger
    privatesub主體_format(cancelasinteger,formatcountasinteger)
    rowsinpage=7
    row=row+1
    ifrow>=rowsinpagethen
    me.pagebreak18.visible=true
    row=-1
    else
    me.pagebreak18.visible=false
    endif
    endsub
    方法二:
    在報(bào)表的代碼界面里面寫(xiě)入以下代碼:
    optioncomparedatabase
    dimrowaslong
    privatesub主體_format(cancelasinteger,formatcountasinteger)
    row=row+1
    ifme.section(acdetail).forcenewpage=1then
    me.section(acdetail).forcenewpage=0
    else
    ifrowmod7=0then
    me.section(acdetail).forcenewpage=1
    row=0
    endif
    endif
    endsub