Login & Logout Error

Page 1 of 1

1 Replies - 355 Views - Last Post: 03 February 2013 - 11:37 AM Rate Topic: -----

#1 dinver21  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 19-January 13

Login & Logout Error

Posted 03 February 2013 - 11:31 AM

[/sql]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[/sql]



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..

Is This A Good Question/Topic? 0
  • +

Replies To: Login & Logout Error

#2 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 858
  • View blog
  • Posts: 2,286
  • Joined: 28-March 11

Re: Login & Logout Error

Posted 03 February 2013 - 11:37 AM

Please don't open duplicate topics.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1