If gintTmode = 1 Then txtSQL = "select * from 表名 where 字段名='" & Trim(text1)& "'" Set mrc = ExecuteSQL(txtSQL, MsgText) If mrc.EOF = False Then MsgBox "已经存在此记录!", vbOKOnly + vbExclamation, "警告" text1.SetFocus Exit Sub End If mrc.Close End If我的窗体为mid窗体
txtSQL = "select * from 表名 where 字段名='" & Trim(text1)& "'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
If mrc.EOF = False Then
MsgBox "已经存在此记录!", vbOKOnly + vbExclamation, "警告"
text1.SetFocus
Exit Sub
End If
mrc.Close
End If我的窗体为mid窗体