有条件地隐藏表单和子表单中的字段 [英] Hiding fields within forms and subforms conditionally
本文介绍了有条件地隐藏表单和子表单中的字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直对隐藏字段感到困惑。
I have been perplexed in regards to hiding fields.
这里我有以下代码片段:
Here I have the following code snippet:
Option Compare Database
Dim Sfrm As [Form_SubFormOne subform]
Private Sub BaseClassPublicRoutineLineNumbersQuery_subform_Enter()
End Sub
Private Sub Detail_Click()
End Sub
Private Sub Form_AfterUpdate()
If Sfrm.CalculationID <> Null Then
Sfrm.CalculationID.Visible = True
Else
Sfrm.CalculationID.Visible = False
End If
End Sub
当我试图向下滚动记录时,子表格保持不变;因此,CalculationID字段仍然可见。
When I tried to scroll down the records, the sub form remained unchanged; therefore, the CalculationID field is still visible.
我如何更正此代码段?
问候,
JohnDBCTX
JohnDBCTX
推荐答案
复制  ;从Form_AfterUpdate到Form_Current事件的代码。只有在您修改了表单中的数据后,才会执行Form_Afterupdate事件。
Copy the code from the Form_AfterUpdate to the Form_Current event. The Form_Afterupdate event will only be executed if you have modified the data in the form.
MatthiasKläy,KläyComputingAG
Matthias Kläy, Kläy Computing AG
这篇关于有条件地隐藏表单和子表单中的字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文