【发布时间】:2014-06-09 21:04:43
【问题描述】:
我有一个带有控制源的选项按钮。该按钮不是选项组的一部分。 When the button is not selected it stores 0 (which is what I want) however, when the option button is selected it stores -1 instead of 1. I cannot seem to find the property in the menu to set the option value.
有没有办法在选择为1而不是-1时设置存储值?
我尝试了 Me.Controls("optionButtonControlName").OptionValue = 1 但出现错误。
我知道我能做到:
If (optBtn.Value = -1) Then
optBtn.Value = 1
End If
每次单击按钮时,都必须有一种更简单的方法来执行此操作,而我只是没有看到。
谢谢!
【问题讨论】:
-
分配
-1时被设置为True -
使用更新后事件并检查它是否设置为
-1。如果是这样,则将另一个控件设置为1。也许是一个隐藏的控件。 -
非常感谢!我使用了您对 AfterUpdate 方法的建议和获得绝对值的@XIVSolutions 建议。