Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Login & Logout Error

$
0
0
Private Sub TDatacode_Change()
If TDatacode.Text = "" Then
TName.Text = ""
TGender.Text = ""
TYear.Text = ""
cpcnum.Text = ""
Tin.Text = ""
Tout.Text = ""
TName.Locked = True
TGender.Locked = True
TYear.Locked = True
cpcnum.Locked = True
Tin.Locked = True
Tout.Locked = True

Else

TName.Locked = True
TGender.Locked = True
TYear.Locked = True
cpcnum.Locked = True
Tin.Locked = True
Tout.Locked = True

connect
    SQL = "SELECT Student_Info.St_SName,Student_Info.St_FName,Student_Info.St_MName, Student_Info.St_Gender, Student_Info.St_Year, Student_Info.St_PPhone,Student_Info.St_Pic, Log.St_Login, Log.St_Logout, Log.St_LogID FROM Student_Info INNER JOIN Log ON Student_Info.St_ID = Log.St_ID where Student_Info.St_ID ='" & Trim(TDatacode.Text) & "'"
    Set rs = conn.Execute(SQL, adExecuteNoRecords)
    If rs.EOF = False Then
       TName.Text = rs!St_SName & ", " & rs!St_Fname & " " & rs!St_MName
       TGender.Text = rs!St_Gender
       TYear.Text = "BSCpE " & rs!St_Year
       cpcnum.Text = rs!St_PPhone

       TLog.Text = rs!St_Logid
       If TLog.Text <> "" And rs!St_Login <> "" Then
       Tin.Text = rs!St_Login
       Tout.Text = Labe1.Caption
       SQL = "update Log set St_Logout =  ('" & Tout.Text & "') "
       Set rs = conn.Execute(SQL, adExecuteNoRecords)
       
       ElseIf rs!St_Login = "" Then
       Tin.Text = Labe1.Caption
       SQL = "insert into Log (St_ID,St_Login,St_Logout) Values ('" & TDatacode.Text & "','" & Tin.Text & "','" & Tout.Text & "') "
       Set rs = conn.Execute(SQL, adExecuteNoRecords)
       End If
    End If
connectclose
End If
End Sub




Need Help Guyz.. i made an attendance record system...(sorry for my english)
i want that if my IDCode is "0001" and the others have 0002,0003,.... and so on..
i want that the first tym i put my code(0001) my Login field of my database would have the value of present time(Labe1.caption)...
Ex.
ScanID Login Logout
0001 11:01PM -----
0002 11:04PM -----
0003 11:10PM -----
0002 11:04PM 11:30PM
0001 11:01PM 11:40PM
0003 11:10PM 11:55PM
0001 12:01AM -----
0002 12:04AM -----
0003 12:10AM -----
0002 12:04AM 12:30AM
0001 12:01AM 12:40AM
0003 12:10AM 12:55AM

just like that... tnx 4 your concern Guyz and please help me
first tym in vb here..

*** Edit ***
Please use code tags when posting code
:code:

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>