Hi,
can any body help me with this one. i'm kinda new with vb in excel. i made this code for my log in form. the log in works if the information inputted is correct. i tried everything to pop up a prompt if the log in info does not match. but i failed. this my code:
Private Sub cmdOk_Click()
Dim i As Integer
Dim l As Integer
Dim j As Integer
Dim final As Integer
Dim msg As String
For i = 1 To 1000
If wrkUser.Cells(i, 1) = "" Then
final = i - 1
Exit For
End If
Next
For l = 1 To final
If wrkUser.Cells(l, 1) = txtUsername And wrkUser.Cells(l, 2) = txtPassword Then
wrkStart.cmdLock.Visible = True
wrkStart.cmdNew.Enabled = True
wrkStart.cmdEdit.Enabled = True
wrkStart.cmdStore.Enabled = True
wrkStart.cmdShow.Enabled = True
Unload Me
Exit For
End If
Next
End Sub
any solutions to this?
its going to be a huge help for me.
can any body help me with this one. i'm kinda new with vb in excel. i made this code for my log in form. the log in works if the information inputted is correct. i tried everything to pop up a prompt if the log in info does not match. but i failed. this my code:
Private Sub cmdOk_Click()
Dim i As Integer
Dim l As Integer
Dim j As Integer
Dim final As Integer
Dim msg As String
For i = 1 To 1000
If wrkUser.Cells(i, 1) = "" Then
final = i - 1
Exit For
End If
Next
For l = 1 To final
If wrkUser.Cells(l, 1) = txtUsername And wrkUser.Cells(l, 2) = txtPassword Then
wrkStart.cmdLock.Visible = True
wrkStart.cmdNew.Enabled = True
wrkStart.cmdEdit.Enabled = True
wrkStart.cmdStore.Enabled = True
wrkStart.cmdShow.Enabled = True
Unload Me
Exit For
End If
Next
End Sub
any solutions to this?
its going to be a huge help for me.