e xin nhờ các anh sửa hộ e cái code form đăng nhập với
Option Compare Database
Dim chuoi As String
Dim i As Integer
Dim solan As Integer
Private Sub Command0_Click()
On Error GoTo Err_Command0_Click
Screen.PreviousControl.SetFocus
DoCmd.FindNext
Exit_Command0_Click:
Exit Sub
Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click
End Sub
Private Sub Command1_Click()
On Error GoTo Err_Command1_Click
Screen.PreviousControl.SetFocus
DoCmd.FindNext
Exit_Command1_Click:
Exit Sub
Err_Command1_Click:
MsgBox Err.Description
Resume Exit_Command1_Click
End Sub
Private Sub Command9_Click()
If IsNull(Me.txtuse) Or Me.txtuse = "" Then
MsgBox "Ban chua dien Ten dang nhap", vbCritical, "User name"
Me.txtuse.SetFocus
Exit Sub
End If
If IsNull(Me.txtpass) Or Me.txtpass = "" Then
MsgBox "Ban phai nhap mat khau cua ban vao o 'Password'.", vbCritical, "Nhap mat khau"
Me.txtpass.SetFocus
Exit Sub
End If
If Me.txtuse = DLookup("username", "tbluser") Then
If Me.txtpass = DLookup("password", "tbluser") Then
MsgBox "Ban da dang nhap thanh cong...", vbInformation, "Dang nhap..."
DoCmd.OpenForm "F_thongbao1", acNormal
DoCmd.Close acForm, "frmdangnhap", acSaveNo
Else
DoCmd.OpenForm "F_Main"
DoCmd.Close acForm, "frmdangnhap", acSaveNo
End If
Else
MsgBox "Mat khau khong dung. Vui long nhap lai.", vbExclamation, "Sai mat khau!"
Me.txtpass.SetFocus
solan = solan + 1
End If
Else
MsgBox "Ten khong dung. Vui long nhap lai.", vbExclamation, "Sai User!"
Me.txtuse.SetFocus
solan = solan + 1
End If
If solan >= 3 Then
MsgBox "Mat khau khong dung, chuong trinh se thoat. Vui long lien he voi Admin.", vbCritical, "Mat khau!"
Application.Quit
End If
End Sub
Private Sub Command11_Click()
On Error GoTo Err_Command11_Click
DoCmd.Quit
Exit_Command11_Click:
Exit Sub
Err_Command11_Click:
MsgBox Err.Description
Resume Exit_Command11_Click
End Sub
Private Sub Form_Timer()
Select Case i
Case 1, 4, 7, 10, 13, 16, 19, 22, 25
Me.Label17.Caption = Left(chuoi, i) & " /"
Case 2, 5, 8, 11, 14, 17, 20, 23, 26
Me.Label17.Caption = Left(chuoi, i) & " --"
Case Else
Me.Label17.Caption = Left(chuoi, i) & " \"
End Select
i = i + 1
If i > Len(chuoi) Then
i = 1
End If
End Sub
mấy anh coi hộ e coi nó sai chỗ nào roi sữa lại hộ e vơi
nhờ các anh sửa lại code đó cho đúng giúp e, e xin cám ơn nhiều