设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

返回列表 发新帖
查看: 678|回复: 0
打印 上一主题 下一主题

[与其它组件] 又是一個報表問題

[复制链接]
跳转到指定楼层
1#
发表于 2005-3-18 00:18:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
我在網上下了一個 Function 來改。

想問一下﹕如果記錄為24或25條時(我設定滿25條記錄換頁﹐每頁不夠25條記錄則補滿25條)為何最后一條記錄會重復多輸出一次﹖

Global TotCount As Integer  '當前行



      Function PrintLines(R As Report, TotGrp)

         Dim Rnd As Long    '定義行數

         Dim Pg As Long     '定義頁數

         Const cln = 25     '設定每頁行數

         Pg = Fix((TotGrp - 1) / cln) + 1   '設定打印頁數

         Rnd = 25 * Pg    '設定打印行數

         

         TotCount = TotCount + 1    '記錄行數加1

         If TotCount = TotGrp Then   '如果當前行等于記錄數

              R.NextRecord = False

         ElseIf TotCount > TotGrp And TotCount < Rnd Then   '不足整頁則打印空白行

              R.NextRecord = False

              R![tab_id].Visible = False

              R![wage_staff_name].Visible = False

              R![wage_post_name].Visible = False

              R![wage_w_Base].Visible = False

              R![wage_w_Turnover].Visible = False

              R![wage_w_Bonus].Visible = False

              R![wage_w_Post].Visible = False

              R![wage_w_Level].Visible = False

              R![wage_w_Outside].Visible = False

              R![Text55].Visible = False

              R![wage_w_Cura].Visible = False

              R![wage_w_Board].Visible = False

              R![wage_w_Drink].Visible = False

              R![wage_w_Snack].Visible = False

              R![wage_w_Tel].Visible = False

              R![wage_w_Car].Visible = False

              R![wage_w_Mini].Visible = False

              R![wage_w_GetMail].Visible = False

              R![wage_w_SendMail].Visible = False

              R![wage_w_Premium].Visible = False

              R![wage_w_Other].Visible = False

              R![Text66].Visible = False

              R![wage_c_Leave].Visible = False

              R![wage_c_Gowrong].Visible = False

              R![wage_c_Insu].Visible = False

              R![wage_c_Board].Visible = False

              R![wage_c_Other].Visible = False

              R![Text67].Visible = False

              R![Text69].Visible = False

              R![Text181].Visible = False

            

         End If

       End Function
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-9-20 17:38 , Processed in 0.089228 second(s), 25 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表