单击复选标记,访问,VBA代码时将值解析为变量

问题描述 投票:0回答:1

单击复选框时,将值解析为数据库中不同字段的VBA代码是什么?

示例代码(不起作用):

Private Sub Step_1_Click()

If Step_1.Value = True Then
Step1_score.Value = 10
End if

End Sub

我删除了“值”并且没有出现代码错误,但10没有显示在db中的Step1_score变量中。有关VBA代码的任何建议,要从复选标记中解析值?谢谢!

ms-access access-vba
1个回答
0
投票

您可能希望使用_AfterUpdate事件来确保在事件触发之前更改Step_1的值:

Private Sub Step_1_AfterUpdate()

If Step_1.Value = True Then
Step1_score.Value = 10
End if

End Sub
© www.soinside.com 2019 - 2024. All rights reserved.