如何在MS访问中的特定记录中链接复选框和按钮
我将在MS访问表单中链接一个复选框和按钮。当不选中复选框时,该按钮将被禁用,并在选中该按钮时启用。 我已经写了行以运行此命令。但是结果并不令人满意。因为当我检查复选框时,所有相同的按钮都将启用。当我取消选中复选框时,所有按钮都会禁用。 (我的意思是,特定记录中的按钮和复选框之间没有链接。) 我的代码是:
private sub reqchooesed_click()
If Me.reqChooesed = True Then
Me.Command1.Enabled = True
Else
Me.Command1.Enabled = False
End If
End Sub
[示例1] [1] [示例2] [2] [1]:https://i.sstatic.net/wnk9m.png [2]:https://i.sstatic.net/oaz6m.png
I am about to link a checkbox and a button in the MS Access form. the button becomes disabled when the checkbox is unchecked and becomes enabled whenever it is checked.
I have written lines to run this command. but the results are not satisfying. because all the same buttons become enabled when I check a checkbox. and all buttons become disabled when I uncheck a checkbox. (I mean there is no link between the button and the checkbox in a specific record.)
My code is:
Private Sub reqChooesed_Click()
If Me.reqChooesed = True Then
Me.Command1.Enabled = True
Else
Me.Command1.Enabled = False
End If
End Sub
[Example 1][1]
[Example 2][2]
[1]: https://i.sstatic.net/wNk9M.png
[2]: https://i.sstatic.net/oaZ6m.png
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用后杜特事件:
但是所有记录都将行为相同。对于单个操作,请将复选框绑定到表中的新布尔字段,然后将按钮移至表单的标头或页脚。
Use the AfterUpdate event:
But all records will behave the same. For individual operation, bind the checkbox to a new Boolean field in the table, and move the button to the header or the footer of the form.