【发布时间】:2017-12-24 15:06:34
【问题描述】:
我有一个名为 TimeQuery 的查询。我希望 MsgBox 将显示所有 [start_hour] 值,其中 [id]=1 然后 2 等等。... 我有个问题。我什么时候用:
a = DLookup("Hour([start_hour])", "TimeQuery", "[id]=1")
效果很好,但使用 [id]=counter 时却不显示。在 For 循环之后我也有一个 MsgBox,当 [id]=counter 它也没有显示那个 MsgBox。怎么了?
For counter = 1 To 3
Dim a As Variant
a = DLookup("Hour([start_hour])", "TimeQuery", "[id]=counter")
MsgBox (counter)
Next
Debug.Print ("")
【问题讨论】:
标签: database vba ms-access msgbox