【问题标题】:With statement for recordset field specification in Access 2003 VBAAccess 2003 VBA 中记录集字段规范的声明
【发布时间】:2011-06-25 00:49:18
【问题描述】:

我知道用 VBA 在记录集中指定字段的两种方法:

FooTable!BarField = 1
FooTable("Bar Field") = 2

但是在 With 块中会发生什么?

With FooTable
    !BarField = 1
    ("Bar Field") = 2
End With

是否可以两者都做,或者有解决方法吗?

【问题讨论】:

    标签: ms-access vba with-statement ms-access-2003


    【解决方案1】:

    以下都是等价的:

    With FooTable
        .Fields("Bar Field").Value = 2  '.Value is default property of a Field object'
        .Fields("Bar Field") = 2  
        ![Bar Field] = 2
    End With
    

    【讨论】:

      猜你喜欢
      • 2017-04-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-07
      • 1970-01-01
      • 2016-08-12
      • 1970-01-01
      • 2017-03-06
      相关资源
      最近更新 更多