# Re: Answer for "login"

Posted by Spencer Yang on April 30, 1999 at 00:43:45:

In Reply to: Inbox的Cancel出了问题(求救)!!! posted by Cloudyland on April 29, 1999 at 21:31:48:

一、你的程式相当别出心裁，让我无从找出无数循环解！
二、请用vb精灵，建立frmLogin,然后加上data控制项，再加些程式码即可！
三、假如frmlogin,程式码大约如下

Private Sub cmdSearch_Click()
Dim strID As String
Dim strMsgBox As String
Dim enumMsgResult As VbMsgBoxResult
' 判断1: txtID是否为空
' 判断2: 判断是否找到 id
' 判断3: 使用者是否按下OK 钮, 是者回到 txtID 栏位, 按下 Cancel 则离开
If txtID.Text <> "" Then
datAF.Recordset.FindFirst "ID =" & Chr(39) & txtID & Chr(39)
If datAF.Recordset.NoMatch Then
strMsgBox = "Not Found(" & txtID.Text & ") this ID!"
enumMsgResult = MsgBox(strMsgBox, vbOKOnly)
If enumMsgResult = vbNo Then
txtID.SetFocus
Exit Sub
Else
Exit Sub
End If
End If
End If
End Sub

Follow Ups: