当按钮单击主窗体时,记录选择失去对子窗体的关注 [英] Record selection losing focus on Subform when button click on main form

查看:73
本文介绍了当按钮单击主窗体时,记录选择失去对子窗体的关注的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个访问数据库,它使用子表单来显示记录,其中一列是费用数据(货币)。我的用户需要根据扫描的纸张形式验证费用,因此我希望允许他们选择这些费用的一部分(转移点击)并将它们汇总到一个消息框中以逐页验证记录是纠正,或找到不正确的记录。我找到了以下vba代码并将其添加到db


在子窗体上设置记录集

I have an access database that uses a subform to display records, one column of which is charge data (currency). My users need to verify the charges against the paper form they are scanned from, so I would like to allow them to select a subset of these charges (shift click) and sum them into a message box to verify page by page that the records are correct, or find incorrect records. I found the following vba code and added it to the db

On the subform to set the record set

展开 | 选择 | Wrap | 行号

推荐答案

对不起,Access 2003,数据表表格
Sorry, Access 2003, Datasheet form


@ thayes5150


我不认为你可以保留记录选择离开子表格,但你可以做的是:
@thayes5150
I don''t think that you can maintain the Records Selection once you leave the Sub-Form, but what you can do is:
  1. 包括一个名为[Sum]的字段,[Yes / No显示为复选框],在您的子表单的记录来源。
  2. 在子表单中包含字段。
  3. 让用户在子表单上选择他/她想要的字段数量为
  4. 运行类似于以下代码(Northwind的订单详细信息扩展查询)以生成所选记录的总计。
  1. Include a Field named [Sum], [Yes/No displayed as Check Box], in the Record Source for your Sub-Form.
  2. Include the Field in the Sub-Form.
  3. Have the User select as many Fields as he/she wants on the Sub-Form to be totalled.
  4. Run code similar to the following (Order Details Extended Query of Northwind) to generate a Total for the Records selected.
展开 | 选择 | Wrap | 行号


不幸的是数据问题有时是20 -30页,每页有50条记录,我不知道如何批量选择复选框(因为你可以在数据表中拖动选择记录)这意味着它们需要检查50个盒子然后总结,然后检查50多个等所有20-30页。是否可以在S键上添加按键事件,这样当他们选择记录并按S时会弹出和信息?
Unfortunately the data in question is sometimes 20 -30 pages with 50 records on each page and I don''t know of a way to mass select the check boxes (as you can drag select records in a data sheet) This means they would need to check 50 boxes, then sum, then check 50 more etc for all 20 -30 pages. Is it possible to add a keypress event, maybe on the S key so when they select the records and press S it pops the sum message?


这篇关于当按钮单击主窗体时,记录选择失去对子窗体的关注的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆