Can you find out what is lacking.. I'm having a hard time debugging.. Please..
Private Sub cmdlogin_Click()
Set connection1 = New ADODB.Connection
Set connection2 = New ADODB.Connection
ctr = 1
currentdate = DateValue(Now)
currenttime = TimeValue(Now)
If txtlogin = "" Then
MsgBox "Please Enter ID Number", vbCritical, "Information"
End If
If ctr = 1 Then
connection1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Database.mdb;Persist Security Info=False"
connection1.Open
rs.Open "Select * from STUDENTS, connection1"
If txtlogin = rs!IDNum Then
MsgBox "Record Found! Log-in Anyway?", vbYesNo, "Information"
If answer = vbYes Then
Set rs = New Recordset
connection2.connectionstrinf = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Database.mdb;Persist Security Info=False"
connection2.Open
rs.Open "Select * from LOGHISTORY", connection2
rs.AddnNew
rs!IDNum = txtlogin
rs!LoginDate = currentdate
rs!LoginTime = currenttime
MsgBox "Log-In Successful", vbInformation, "Information"
Else
MsgBox "ID Number Not Found", vbInformation, "Information"
End If
End If
End If
End If
End Sub
This post has been edited by AdamSpeight2008: 15 November 2012 - 09:18 PM

New Topic/Question
Reply



MultiQuote





|