End If
翻译一下:
If DCount("*", "表名", "字段1='" & 当前窗体字段1 & "'" ) > 0 Then MsgBox "此数据已录入,请不要重复添加!" Exit Sub
DoCmd.OpenQuery "查询名称"