A
anubislg
Hello!
I'm rather new to VBA, and Access in whole, so please bear with me.
I'm currently trying to create a form that will automatically fill in
the current time when a user inputs data into a specific text box. In
short, I wish to make a form that when an employee enters there
employee number, it will log the current time.
Now, I've got it to where when I input the employee number into the
text box, the time field will automatically update with the current
time...but the number one main problem I've ran into, is when you
re-open the form, the time updates to the current time that you opened
the form, not the first time of clock-in!
Current code that I'm using is:
In the Control Source of the "Start Time";
=IIf(IsNull([Clock In]),Null,IIf(IsNull([Main]![Topaz Start
Time]),Now([Main]![Topaz Start Time]),[Main]![Topaz Start Time])
Now, this code (at least to me) should work. In essance, it should
check to see if [Clock In] is null, if it is, then enter no
information, if it isn't null though, then check to see if the record
[Main]![Topaz Start Time] is null, if it is, then fill in the record
with the current time, if the record isn't null, then return the
record. But it seams that I've gone astray somewhere with this
formula. Could anyone offer me some hints? Thank you all!
-Matthew
I'm rather new to VBA, and Access in whole, so please bear with me.
I'm currently trying to create a form that will automatically fill in
the current time when a user inputs data into a specific text box. In
short, I wish to make a form that when an employee enters there
employee number, it will log the current time.
Now, I've got it to where when I input the employee number into the
text box, the time field will automatically update with the current
time...but the number one main problem I've ran into, is when you
re-open the form, the time updates to the current time that you opened
the form, not the first time of clock-in!
Current code that I'm using is:
In the Control Source of the "Start Time";
=IIf(IsNull([Clock In]),Null,IIf(IsNull([Main]![Topaz Start
Time]),Now([Main]![Topaz Start Time]),[Main]![Topaz Start Time])
Now, this code (at least to me) should work. In essance, it should
check to see if [Clock In] is null, if it is, then enter no
information, if it isn't null though, then check to see if the record
[Main]![Topaz Start Time] is null, if it is, then fill in the record
with the current time, if the record isn't null, then return the
record. But it seams that I've gone astray somewhere with this
formula. Could anyone offer me some hints? Thank you all!
-Matthew