hi,
i'd like to create a log file..
There is one form that has a list box where it shows all the login and logout times.
Code for Form load
[code=vb]
Private Sub Form_Load()
'
Dim dbmyDB As Database
Dim rsmyRS As Recordset
Set dbmyDB = OpenDatabase("E :\skol\A2 Computing\Speed y Pizza database.mdb")
Set rsmyRS = dbmyDB.OpenReco rdset("Log file", dbOpenDynaset)
If Not rsmyRS.EOF Then rsmyRS.MoveFirs t
Do While Not rsmyRS.EOF
List1.AddItem rsmyRS!Log
List1.ItemData( List1.NewIndex) = rsmyRS!Log
rsmyRS.MoveNext
Loop
rsmyRS.AddNew
List1.Text = rsmyRS!Log
rsmyRS.Update
End Sub
Listbox code
Private Sub List1_Click()
rsmyRS.FindFirs t "Log=" & (List1.ItemData (List1.ListInde x))
List1.Text = rsmyRS!Log
End Sub
[/code]
the way the times are entered is when the user logs in i additem "login time the date and time " and when the user logs out the same thing but logout instead of login. when the user logs out the data should be saved. my problem is that it either saves it but field is empty in access or an array problem. so i ain't bothered with my coding. i was hoping if anyone can suggest a code that may work. please
Thank YoU
i'd like to create a log file..
There is one form that has a list box where it shows all the login and logout times.
Code for Form load
[code=vb]
Private Sub Form_Load()
'
Dim dbmyDB As Database
Dim rsmyRS As Recordset
Set dbmyDB = OpenDatabase("E :\skol\A2 Computing\Speed y Pizza database.mdb")
Set rsmyRS = dbmyDB.OpenReco rdset("Log file", dbOpenDynaset)
If Not rsmyRS.EOF Then rsmyRS.MoveFirs t
Do While Not rsmyRS.EOF
List1.AddItem rsmyRS!Log
List1.ItemData( List1.NewIndex) = rsmyRS!Log
rsmyRS.MoveNext
Loop
rsmyRS.AddNew
List1.Text = rsmyRS!Log
rsmyRS.Update
End Sub
Listbox code
Private Sub List1_Click()
rsmyRS.FindFirs t "Log=" & (List1.ItemData (List1.ListInde x))
List1.Text = rsmyRS!Log
End Sub
[/code]
the way the times are entered is when the user logs in i additem "login time the date and time " and when the user logs out the same thing but logout instead of login. when the user logs out the data should be saved. my problem is that it either saves it but field is empty in access or an array problem. so i ain't bothered with my coding. i was hoping if anyone can suggest a code that may work. please
Thank YoU
Comment