《Access快速开发基础教程》免费视频(53)
时 间:2023-04-30 11:54:36
作 者:张志 ID:8 城市:上海 QQ:2851379730
摘 要:《Access快速开发基础教程》书籍第53课4.3.7连续窗体显示数据
正 文:
连续窗体显示数据
之前创建了一个【frmMoneyCountList】连续窗体,可以对这个窗体进行复制,粘贴为【frmTimeCountList】窗体,然后进行适当较少工作量的修改,即可满足设计的需要,比新创建一个窗体要节约不少时间,具体操作步骤如下。
步骤01:①在导航窗格选中【frmMoneyCountList】,单击鼠标右键,②在右键菜单中单击【复制(C)】,然后再单击鼠标右键,在右键菜单中单击【粘贴(P)】,把窗体命名为:frmTimeCountList,如图1所示。
步骤02:在导航窗格选中【frmTimeCountList】窗体,进入窗体设计界面,如图2所示。

步骤03:将“收入(元)”改为“月度(小时)”,“支出(元)”改为“年度(小时)”,并调整宽度,如图3所示。

步骤04:删除最后4列,并将前4列中的列标题“月计划”、“月实际”、“年计划”、“年实际”改为“计划”和“实际”,调整窗体宽度,如图4所示。

步骤05:①双击左上角的小黑方块■,出现该窗体的属性,②切换到【数据】选项卡,③找到【记录源】,如图5所示。

步骤06:单击【记录源】的组合框,选择:qryTimeCount,如图6所示。

步骤07:对控件宽度进行调节,更改文本框的控件来源和窗体页脚的公式,如图7所示。

步骤08:①选中【TCategory】文本框,②在属性表【其他】选项卡中,③将【名称】改为:Tcategory,如图8所示。

步骤09:①切换到【事件】选项卡,②单击事件过程右边的【…】按钮,如图9所示。

进入VBA窗口后,如图10所示。

步骤10:从图4-136可以看出,两个代码只是名称不同,将M改为T即可,然后删除下方空白的事件过程,如图11所示。

步骤11:在【frmTimeCountList】窗体双击类别时,代码设置的是【frmTimeCount】窗体,由于此窗体之前是从【frmMoneyCountList】窗体复制过来的,因此需要将代码中的相关控件名称进行修改,需要将Money替换为Time,可以批量替换,在双击事件代码区内单击一下鼠标左键,然后同时按【Ctrl +H】键,①选择【当前过程】,②单击【全部替换】,如图12所示。
步骤12:将倒数第二行代码中的Me.MCategory改为Me.TCategory,代码修改后如图13所示。

关闭VBA设计窗口,保存并关闭【frmTimeCountList】窗体,接下来要把【frmTimeCountList】窗体作为【frmTimeCount】窗体的子窗体。
步骤13:在导航窗格中选中【frmTimeCount】,单击鼠标右键进入窗体设计视图,①选中子窗体控件,双击显示属性表,②在【数据】选项卡中,③找到【源对象】,如图14所示。

步骤14:在【源对象】中选择:frmTimeCountList,如图15所示。

保存并关闭【frmTimeCount】窗体,在导航窗格选中【frmTimeCount】双击打开窗体,效果如图16所示。

视频讲解
点击:https://m.qlchat.com/wechat/page/topic-intro?topicId=2000017100037365 (打开网页后用微信扫描登录)
Access软件网QQ交流群 (群号:54525238) Access源码网店
常见问答:
技术分类:
源码示例
- 【源码QQ群号19834647...(12.17)
- 按回车键后光标移动到下一条记录...(02.12)
- 【Access Dsum示例】...(02.07)
- Access对子窗体的数据进行...(02.05)
- 【Access高效办公】上月累...(01.09)
- 【Access高效办公】上月累...(01.06)
- Inputbox输入密码打开查...(12.23)
- 【Access Dsum示例】...(12.16)
- Inputbox输入密码打开窗...(12.13)
- 【Access DCount示...(12.02)

学习心得
最新文章
- 用Access查询语句如何得到前3...(02.17)
- Access快速开发平台--导入导...(02.14)
- 按回车键后光标移动到下一条记录的V...(02.12)
- Access快速开发平台--要实现...(02.10)
- Access快速开发平台--让Pe...(02.08)
- 【Access Dsum示例】用D...(02.07)
- Access对子窗体的数据进行平均...(02.05)
- Access快速开发平台附件上传,...(01.18)
- 【IIF函数示例】用iif函数判断...(01.18)
- Access快速开发平台--如何获...(01.17)