1
Private Sub txtUserCode_Validate(Cancel As Boolean)
If RS!ID = txtUserCode.Text Then
SQL = "SELECT NAME,PRIVILEDGE FROM ADMIN WHERE CODE=" & txtUserCode.Text
Set RS = CN.Execute(SQL)
txtUserName.Text = RS!NAME
Else
MsgBox "ENTER VALID NO"
txtUserCode.Text = ""
Cancel = True
End If
End Sub
在这段代码我要执行这样的:如何处理文本框验证?
如果我进入存在于表中的ID,然后它会显示信息,但它正在考虑第一个记录(
RS!ID(0)
)不仅没有下一个如果我输入不在表中的ID,那么它不应该抛出错误
3021- Requested operation requires current record
但是转到其他部分。
请帮助