|
huanghai,好久不见了,请你帮我看一下这段代码有何错误,我的电话18917878286,请把你的手机号发短信我
Dim dbSS As Double
Dim dbSE As Double
Dim dbAS As Double
Dim dbAE As Double
Set rst = CurrentDb.OpenRecordset("select Item_SS,Item_SE,Item_AS,Item_AE from tb_Test_Item where Item_ID = [me.Item_ID]")
dbSS = rst("Item_SS")
dbSE = rst("Item_SE")
dbAS = rst("Item_AS")
dblAE = rst("Item_AE")
If Nz(Item_Data.Value) > dbSS And Nz(Item_Data.Value) < dbSE Then
Exit Sub
Else
MsgBox "超出了标准范围,请检查是否录入错误"
Cancel = True
End If
if Nz(Item_Data.Value) > dbAS And Nz(Item_Data.Value) < dbAE Then
Exit Sub
Else
MsgBox "超出了警戒值,请报告此情况"
Cancel = True
End If
rst.Close
Set rst = Nothing
End Sub
我本来是想搞一个纠错功能,当用户录入的值超出范围时,报警提示,可是不起作用,根本触发不了这段代码
能帮我看出错误在哪里吗?
|
|