张根良 发表于:2007-11-08 20:37:25
如何判断二个字段都没有重复时才会保存记录成功?
Me.RefreshIf Acchelp_StrDataIsExist("tblCode_ejzc", "zcmc", Me.zcmc) = True ThenMsgBox "你输入的资产名称已经存在,请重新输入", vbCritical, "警告"Me.zcmc.SetFocusExit SubEnd If
以上是判断zcmc(资产名称)字段里所填名称是否已存在的代码,那如果我再加一个字段ggxh(规格型号)时如何判断?即:只有二个字段zcmc和ggxh都已存在时才"警告",否则就充许保存.是不是("tblCode_ejzc", "zcmc", Me.zcmc)改为("tblCode_ejzc", "zcmc" and "ggxh", Me.zcmc and Me.ggxh)就成功?帖子被bamboo修改于2007-11-8 20:40:54
If Acchelp_StrDataIsExist("tblCode_ejzc", "zcmc", Me.zcmc) = True
改为:
If Acchelp_StrDataIsExist("tblCode_ejzc", "zcmc", Me.zcmc) = True And Acchelp_StrDataIsExist("tblCode_ejzc", "ggxh", Me.ggxh) = True Then
成功!!!
总记录:2篇 页次:1/1 9 1 :