I have a project which deal with DAILY TIME RECORD, i want to add the time in my form to the current record. Here it is.

if i enter my EmployeeID then click cmdFind the records will be given

Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset

Private Sub cmdFind_Click()
    rs.Find "EmployeeID = '" & txtIDnumber.Text & "'", , , 1
    TextLastName.Text = rs.Fields!LastName
    TextFirstName.Text = rs.Fields!FirstName
    TextLocation.Text = rs.Fields!Location
End Sub

Then when i press cmdLOGIN the Time and Date in my Form should be placed in the current record

Private Sub cmdLogin_Click()
    
End Sub

Private Sub Timer1_Timer()
    lblTime.Caption = Format(Time, "ttttt")
    lblDate.Caption = Format(Date, "mm.dd.yyyy")
    
End Sub

Thanks in advance.

a Bit confusing, but if I understand this correctly, the 2 scenarios...

First your time format is incorrect -

lblTime.Caption = Format(Time, "hh:mm:ss")

If you want to add this to your record in the table (Looks like you are using a data control?) -

'Make sure you have the fields "Date" AND "Time" in your table

Rs.Fields!Date = lblDate.Caption
Rs.Fields!Time = lblTime.Caption

This should solve your problem, did it?

a Bit confusing, but if I understand this correctly, the 2 scenarios...

First your time format is incorrect -

lblTime.Caption = Format(Time, "hh:mm:ss")

If you want to add this to your record in the table (Looks like you are using a data control?) -

'Make sure you have the fields "Date" AND "Time" in your table

Rs.Fields!Date = lblDate.Caption
Rs.Fields!Time = lblTime.Caption

This should solve your problem, did it?

Thanks you very much for your help, now i can go now with my project.
thanks again.

Hi ferkevin04,
Read Andret's signature, it says "Please mark your post as SOLVED when your question has been answered." so I think if your problem is solved then mark it as solved.
Thanks

This article has been dead for over six months. Start a new discussion instead.