在获得使用复选框子窗体 [英] using checkbox in subform in access
问题描述
我想用一个复选框子窗体显示,如果已经付款或没有,希望把它从子窗体编辑。
I want to use a checkbox in a subform to show if the payment has been made or not and want to make it editable from the subform.
现在的问题是,如果我选择或不选择子窗体中的其他行也受影响的复选框,并在原表中的数据发生变化。我怎样才能避免这种情况?
The problem is if I check or uncheck the checkbox in the subform other rows are also affected and the data in the original table is changed. How can I avoid this?
任何建议是高度AP preciated。
Any suggestion is highly appreciated.
推荐答案
创建另一个表。我打电话给我的 Selection_Table
与选择
字段(复选框)和场的recordId
(如FK)。
create another table. I called mine Selection_Table
with a selection
field (checkbox) and field RecordID
(as FK).
您可以使用这个子窗体。然后VBA可以用来选择的recordId
从 Selection_Table
,其中选择
= 1。
You can then use this in the subform. Then VBA can be used to select recordID
from Selection_Table
where selection
=1.
这是我亲密的形式我也有以下code,以确保未来的场合都不会影响当前的选择。
on my close form I also have the following code, to ensure future occasions are not affected by current selections.
db.execute(DELETE * FROM Selection_Table)
这篇关于在获得使用复选框子窗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!