Time monitoring

asanda

New member
Local time
Today, 15:16
Joined
Oct 6, 2008
Messages
2
I have a problem

I am creating a time access control monitoring system that will record the time in for the employees as well as the the time out from work. the employees must login to the system when they come in. I Have a database with the field for time in. I want the VB to enter timein on the field when the user login. I've created the login form and it working fine. I have two table on my database one for login username and password and the otherone for workshift, they are linked together via a username. the time in field is in the workshift table. but dont know how to enter the time on the timeIn field of the database. plz help

this is the code but its giving me an error "can't assign to read only property"

Private Sub cmdOK_Click()
Dim Db As Database
Dim rs As New Connection
Set Db = OpenDatabase("PROVIDER=MSDataShape;Data PROVIDER=Microsoft.Jet.OLEDB.3.51;Data Source=D:\20-07-08\dbPROJECT6.mdb;")

'check for any record, if there is no record there could be error when looping
If Data1.Recordset.RecordCount = 0 Then
MsgBox ("No recordset")
Exit Sub
End If
'check for correct username and password
Data1.Recordset.MoveFirst
Do While Not Data1.Recordset.EOF
If txtUserName = Data1.Recordset.Fields("Username") Then
If txtPassword = Data1.Recordset.Fields("Password") Then
LoginSucceeded = True
Set rs = Db.OpenRecordset("select * from WorkDone")
rs.AddNew
rs![UserName] = txtUserName.Text
rs![TimeIn] = Now
rs.Update
frmMain.Show
Me.Hide
End If
End If
Data1.Recordset.MoveNext
Loop
If Not LoginSucceeded Then
MsgBox "Invalid UserName/Password, try again!", , "Login"
'txtUserName.Clear
'txtPassword.Clear
txtPassword.SetFocus
SendKeys "{Home}+{End}"
Else
Unload Me
End If
End Sub:confused:
 
Couple of things

Where have you set Rs
What is Data1
Which line is generating the error
 

Users who are viewing this thread

Back
Top Bottom