使用表单中的按钮增加表中的数字 [英] Increasing Numbers in Table Using a Button in Form

查看:55
本文介绍了使用表单中的按钮增加表中的数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对VBA知之甚少,所以请耐心等待。


我有一个表格,我希望用来更改表格中的数据。在表单中,有一个组合框,您可以在其中选择不同的员工。此信息的一部分是自动编号,用于标识每个信息,员工姓名和贷记加班。我的愿景是
有三个选项按钮 - 接受,拒绝和无能为力 - 每个会在表格中相应员工的"Credited Overtime"字段中增加4个小时。例如,如果您在组合框中选择了John Doe,则可以选择Accepted
按钮,它会将数字4添加到John Doe的Credited Overtime字段中的任何内容。如果他已经被加入了12个加时赛,那么他现在可以被记入16个。这样我们就可以跟踪谁已被加班加点,谁没有加班。


我'我花了一天时间试图解决这个问题,但我觉得我需要在VBA上学习一两个课程来学习如何使用它。有什么想法?

解决方案

乔尔


是基于相同的表作为形式加班时间存储在哪里?如果是这样,你应该可以尝试这样的:


Me.OverTimeHours = Me.OverTimeHours + 4



希望它有所帮助......


I know little about VBA, so bear with me.

I have a form that I wish to use to change data in a table. In the form, there is a combo box where you can select different employees. Part of this information is an AutoNumber to identify each one, the Employee Name, and Credited Overtime. My vision is to have three Option Buttons - Accepted, Refused, and Incapable - that will each add 4 hours to the corresponding employee's 'Credited Overtime' field in the table. For example, if you selected John Doe in the combo box, you could then select the Accepted button and it would add the number 4 to whatever was in John Doe's Credited Overtime field. If he was already credited with 12 overtime hours, he would now be credited with 16. This way we can keep track of who has been credited with overtime and who hasn't.

I've spent the day trying to figure this out, but I feel that I need a full class or two on VBA to learn how to use it. Any thoughts?

解决方案

Hi Joel,

Is your form based on the same table as where the overtime hours are stored? If so, you should be able to try something like:

Me.OverTimeHours = Me.OverTimeHours + 4

Hope it helps...


这篇关于使用表单中的按钮增加表中的数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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