Capture Current Time

paulsimo

Registered User.
Local time
Today, 11:21
Joined
Nov 11, 2007
Messages
24
Having had a look at another thread under forms, I figure this could help me out with my problem.
I want a form to have just 2 fields (ID Number & Rec Time).

In the database I was looking at, posted at
http://www.access-programmers.co.uk/forums/showthread.php?t=134084
&highlight=insert+time&page=2

In the Student Mgmt database (zip file attached) the tick box, when checked inserts the current date into the Converted Date field.

What I would like is to have a text box that I can enter the ID Number and when I press enter for it to automatically insert the current time into the Rec Time field.

I tried adjusting the Student Mgmt database, removing the unwanted fields, adding a text box and altering the code in the after update section of Converted date to allow it to display time. I managed to get it to insert the correct current time, but it filled all the ID Number records with the same information.

Could anybody please help me out with this dilemma, and possibly direct me as to where I am going wrong, or even build the seemingly simple 2 field form for me.
 

Attachments

Assuming that you have a form with a textbox control for an 'ID' (let's call it txtID) and another textbox control to hold the time (txtTimeEntered), and that these are each bound to fields in a table, then this should be very simple.

In the after_update event of txtID put something like
Code:
If Me.txtID & "" <> "" then
Me.txtTimeEntered = Time()
Else
Me.txtTimeEntered=Null
End if
 
You are an absolute star CraigDolphin, I have spent hours trying to sort this one out, with much frustration.

I only just discovered the forum a couple of days ago, what a superb source of information.

Keep up the good work, you have certainly helped me out.

Many thanks.
Paul:):):)
 

Users who are viewing this thread

Back
Top Bottom