简体   繁体   English

MS Access更新值为NULL

[英]MS Access update Value as NULL

I have the following code on fieldApplicationType 我在fieldApplicationType上有以下代码

Private Sub fieldApplicationType_AfterUpdate()
    If (Me.fieldApplicationType.Value = 200 Or Me.fieldApplicationType.Value = 300) Then
        Me.fieldPrimaryBusinessFunction.Enabled = True
    Else
        Me.fieldPrimaryBusinessFunction.Enabled = False
    End If
End Sub

What I want to be able to do is in the Else not only do I want to disable the field (which is working) I also want to set the Value to NULL if it isn't currently already NULL. 我想做的是在Else不仅要禁用该字段(正在运行),而且还希望将Value设置为NULL(如果当前尚未为NULL)。

Doing Me.fieldPrimaryBusinessFunction.Value = Null is not changing anything however. 正在执行Me.fieldPrimaryBusinessFunction.Value = Null不会更改任何内容。 fieldPrimaryBusinessFunction is a ComboBox. fieldPrimaryBusinessFunction是一个组合框。

The Row Source for the ComboBox are coming from a view and Limit To List is Yes along with Allow Value List Edits ComboBox的Row Source来自视图,“ Limit To List为“是”以及“ Allow Value List Edits

Have you tried: 你有没有尝试过:

Me.fieldPrimaryBusinessFunction.Value = Me.fieldPrimaryBusinessFunction.DefaultValue

That's assuming your default value is null. 假设您的默认值为null。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM