旋转按钮刷新 [英] Spin button refresh

查看:78
本文介绍了旋转按钮刷新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用表格访问医疗库存系统。这个表单我想让用户使用向上和向下箭头(旋钮)来修改OnHand。数量。


旋转按钮工作正常。我在SpinButton_Updated中放置了一个刷新,以便用户可以看到更改的数量。但是,如果用户只是希望从文本框中手动更改数量,则会出现运行时2115,表示设置为BeforeUpdate或Validation规则属性的宏或函数阻止了对保存数据的访问。刷新命令会抛出错误。

Working on a form in access for medical inventory system. This form I want to allow the user to use up and down arrows (spinbutton) to modify the "OnHand" quantity.

The spin button works fine. I placed a refresh in SpinButton_Updated so that the user could see the qty being changed. However, if the user simply wishes to change the amount by hand from the text box I have a Runtime ''2115'' that is thrown saying that a macro or function set to the BeforeUpdate or Validation rule property is preventing access from saving data. The error is thrown at the refresh command.

展开 | 选择 | Wrap | 行号

推荐答案

最好的方法管理这是使用错误处理来否定该错误 - 因为如果你接受手动输入的值,没有任何东西真正导致任何破坏:

The best way to manage this is to use error handling to negate that error--since there is nothing that is really causing anything to break if you accept the value entered manually:

展开 | 选择 | Wrap | 行号


Sweet !非常感谢Twinnyfo(再一次)为您提供了很棒的帮助。
Sweet! Thank you so much Twinnyfo (once again) for your awesome help.


您还应该检查并查看输入到文本框中的值是否为NULL,是否为数字,并且位于旋转按钮控制的可接受范围(MIN <==> MAX)。为了完成所有这些并实际将值写回Spin Button Control,我创建了一个简单的Demo for。显然,它对文本框的AfterUpdate()事件中存在关于控件名称和代码的假设。
You should also check and see if the Value entered into the Text Box is not NULL, is Numeric, and is within the acceptable Range (MIN <==> MAX) of the Spin Button Control. To accomplish all that and actually write the Value back to the Spin Button Control, I created a simple Demo for. Obviously, it makes assumptions about Control Names and the Code exists in the AfterUpdate() Event of the Text Box.
展开 | 选择 | Wrap | 行号


这篇关于旋转按钮刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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