If IsNull(Me![name]) Then
MsgBox "請選擇用登入使用者!", 64, "系統提示"
Me![name].SetFocus
Else
If IsNull(Me![password]) Then
MsgBox "請輸入密碼,密碼不能為空!", 64, "系統提示"
Me![password].SetFocus
Dim stemp As String
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
stemp = "select * from 使用者表 where 使用者名稱="" & Me![name] & """
rs.Open stemp, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
If rs("密碼") <> Me![password] Then
MsgBox "密碼錯誤,請重新輸入!", vbOKOnly, "系統提示"
Me![password] = ""
DoCmd.Close
DoCmd.OpenForm "主選單"
End If
If IsNull(Me![name]) Then
MsgBox "請選擇用登入使用者!", 64, "系統提示"
Me![name].SetFocus
Else
If IsNull(Me![password]) Then
MsgBox "請輸入密碼,密碼不能為空!", 64, "系統提示"
Me![password].SetFocus
Else
Dim stemp As String
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
stemp = "select * from 使用者表 where 使用者名稱="" & Me![name] & """
rs.Open stemp, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
If rs("密碼") <> Me![password] Then
MsgBox "密碼錯誤,請重新輸入!", vbOKOnly, "系統提示"
Me![password] = ""
Me![password].SetFocus
Else
DoCmd.Close
DoCmd.OpenForm "主選單"
End If
End If
End If