【问题标题】:Trying to get a property set based on a combobox selection in access 2010尝试根据 access 2010 中的组合框选择获取属性集
【发布时间】:2014-02-24 15:10:41
【问题描述】:

我以为我已经弄清楚了,但我正在尝试根据两个组合框选择来设置表单中字段的值。我测试的前几个结果很好,但是当我添加更多时,我停止了结果。

到目前为止的代码片段:

If (Product_Select = "Krystar 20kg") Then
    If (Batch_Number_Select = "Batch 1") Then
        DoCmd.SetProperty "Text5", , "60"
    ElseIf (Batch_Number_Select = "Batch 2") Then
        DoCmd.SetProperty "Text5", , "61"
    ElseIf (Batch_Number_Select = "Batch 3") Then
        DoCmd.SetProperty "Text5", , "62"
    ElseIf (Batch_Number_Select = "Batch 4") Then
        DoCmd.SetProperty "Text5", , "63"
    ElseIf (Batch_Number_Select = "Batch 5") Then
        DoCmd.SetProperty "Text5", , "64"
    End If
End If

有人看出什么不对了吗?语法看起来不错。

【问题讨论】:

    标签: ms-access combobox vba ms-access-2010


    【解决方案1】:

    我不使用DoCmd.SetProperty,所以我必须查一下。第二个参数的默认值为acPropertyEnabled,而您似乎希望将其设置为acPropertyValueMe.Text5 = "60" 对你不起作用有什么原因吗?

    【讨论】:

      猜你喜欢
      • 2020-04-07
      • 1970-01-01
      • 1970-01-01
      • 2019-12-07
      • 1970-01-01
      • 1970-01-01
      • 2019-03-14
      • 1970-01-01
      • 2011-02-21
      相关资源
      最近更新 更多