注意数据类型:
“BeforeUpdate(Cancel As Integer)”作者: 老鬼 时间: 2009-9-29 08:26
我的代码如下:
Private Sub AslMatieralCode_BeforeUpdate(Cancel As Integer)
On Error Resume Next
nData = Me.AslMatieralCode
luv = DCount("*", "code", "是否取消=false and 存货编码='" & nData & "'")
If luv = 0 Then
Cancel = true
DoCmd.OpenForm "mainCodeSel"
End If
End Sub
经测试,CANCEL=TRUE和CANCEL=1的效果是一样的。
另外,我的数据表是SQL SERVER的链接表。
谁能帮一下?作者: koutx 时间: 2009-9-29 09:58 本帖最后由 koutx 于 2009-9-29 10:57 编辑