温度从0-40, 视密只有奇数,现要查询标密,做一窗体,三文本框,分别为"温度","视密",标密" 写了一段如下, 显示错误13,不知错在哪里?如何改?DLOOKUP 语句是否适用于双参数查询?请指教.
Private Sub 标密_Click()
Dim aa As Integer, ab As Single, bb As Single, cc As Single
aa = Int(Me.视密)
ab = (Me.温度)
If aa Mod 2 = 1 Then
Me.标密 = DLookup("[标密]", "标密", "[温度]=" & ab And "[视密]=" & aa)
Else
bb = DLookup("[标密]", "标密", "[温度]=" & ab And "[视密]=" & aa)
cc = DLookup("[标密]", "标密", "[温度]=" & ab And "[视密]=" & aa + 1)
Me.标密 = bb + (cc - bb) / (Val(Me.视密) - aa)
End If
End Sub