automagically inputting the current date and time

G

gglazer

I have a field in which I would like to record the date a change is made to a
record. I have such a time/date field, formatted like this:

dd mmm yyyy hh:nn:ss

The default value is =Now() . What I want is to have Access immedately
change the value of the field to the current date and time every time I tab
through the field on the form. Suboptimally, is there a short hand method
for entering the current time and date without explicitly typing the whole
thing in?

TIA,

Glenn
 
A

AlCamp

gglazer,
Use the OnEnter event for the control...
[YourControlName] = Now
Whenever you enter the field, or tab through it, it will be updated with
the latest Date and Time.
hth
Al Camp
 
G

gglazer

Hi, Al.

Perhaps I am misunderstanding what you mean by [YourControlName]. When I
open up the property sheet for the control called "Membership Change Date"
and clickthe Event tab, I put [Membership Change Date] = Now in the OnEnter
event.

Now, when I tab into the field, I get an error saying that Microsoft Access
can't find the macro [Membership Change Date] = Now . I've also tried
various combinations of spacing, leaving off the [] and Now() instead of Now.

Suggestions?

TIA,

Glenn

AlCamp said:
gglazer,
Use the OnEnter event for the control...
[YourControlName] = Now
Whenever you enter the field, or tab through it, it will be updated with
the latest Date and Time.
hth
Al Camp

gglazer said:
I have a field in which I would like to record the date a change is made to
a
record. I have such a time/date field, formatted like this:

dd mmm yyyy hh:nn:ss

The default value is =Now() . What I want is to have Access immedately
change the value of the field to the current date and time every time I
tab
through the field on the form. Suboptimally, is there a short hand method
for entering the current time and date without explicitly typing the whole
thing in?

TIA,

Glenn
 
A

AlCamp

gglazer
Place your cursor in the OnEnter property of [Membership Change Date].
Using the down arrow displayed on the right of the line, select [Event
Procedure]
Now select the little box with (...) on the right of that line.
You should see...

Private Sub Membership_Change_Date_Enter()

End Sub

Between those 2 lines is where you place the code that will run every
time you Enter the Private Sub [Membership Change Date] field...

Private Sub Membership_Change_Date_Enter()
[Membership Change Date] = Now
End Sub

hth
Al Camp

gglazer said:
Hi, Al.

Perhaps I am misunderstanding what you mean by [YourControlName]. When I
open up the property sheet for the control called "Membership Change Date"
and clickthe Event tab, I put [Membership Change Date] = Now in the
OnEnter
event.

Now, when I tab into the field, I get an error saying that Microsoft
Access
can't find the macro [Membership Change Date] = Now . I've also tried
various combinations of spacing, leaving off the [] and Now() instead of
Now.

Suggestions?

TIA,

Glenn

AlCamp said:
gglazer,
Use the OnEnter event for the control...
[YourControlName] = Now
Whenever you enter the field, or tab through it, it will be updated
with
the latest Date and Time.
hth
Al Camp

gglazer said:
I have a field in which I would like to record the date a change is made
to
a
record. I have such a time/date field, formatted like this:

dd mmm yyyy hh:nn:ss

The default value is =Now() . What I want is to have Access immedately
change the value of the field to the current date and time every time I
tab
through the field on the form. Suboptimally, is there a short hand
method
for entering the current time and date without explicitly typing the
whole
thing in?

TIA,

Glenn
 
G

gglazer

Thanks, Al, that works perfectly!

Best,

Glenn

AlCamp said:
gglazer
Place your cursor in the OnEnter property of [Membership Change Date].
Using the down arrow displayed on the right of the line, select [Event
Procedure]
Now select the little box with (...) on the right of that line.
You should see...

Private Sub Membership_Change_Date_Enter()

End Sub

Between those 2 lines is where you place the code that will run every
time you Enter the Private Sub [Membership Change Date] field...

Private Sub Membership_Change_Date_Enter()
[Membership Change Date] = Now
End Sub

hth
Al Camp

gglazer said:
Hi, Al.

Perhaps I am misunderstanding what you mean by [YourControlName]. When I
open up the property sheet for the control called "Membership Change Date"
and clickthe Event tab, I put [Membership Change Date] = Now in the
OnEnter
event.

Now, when I tab into the field, I get an error saying that Microsoft
Access
can't find the macro [Membership Change Date] = Now . I've also tried
various combinations of spacing, leaving off the [] and Now() instead of
Now.

Suggestions?

TIA,

Glenn

AlCamp said:
gglazer,
Use the OnEnter event for the control...
[YourControlName] = Now
Whenever you enter the field, or tab through it, it will be updated
with
the latest Date and Time.
hth
Al Camp

I have a field in which I would like to record the date a change is made
to
a
record. I have such a time/date field, formatted like this:

dd mmm yyyy hh:nn:ss

The default value is =Now() . What I want is to have Access immedately
change the value of the field to the current date and time every time I
tab
through the field on the form. Suboptimally, is there a short hand
method
for entering the current time and date without explicitly typing the
whole
thing in?

TIA,

Glenn
 
M

MeSteve

I try this and then I am unable to move to another record. Also, when I try
to close the form, a popup says "the form cannot be closed at this time, do I
want to continue?" then closes without saving. What's going on?

gglazer said:
Thanks, Al, that works perfectly!

Best,

Glenn

AlCamp said:
gglazer
Place your cursor in the OnEnter property of [Membership Change Date].
Using the down arrow displayed on the right of the line, select [Event
Procedure]
Now select the little box with (...) on the right of that line.
You should see...

Private Sub Membership_Change_Date_Enter()

End Sub

Between those 2 lines is where you place the code that will run every
time you Enter the Private Sub [Membership Change Date] field...

Private Sub Membership_Change_Date_Enter()
[Membership Change Date] = Now
End Sub

hth
Al Camp

gglazer said:
Hi, Al.

Perhaps I am misunderstanding what you mean by [YourControlName]. When I
open up the property sheet for the control called "Membership Change Date"
and clickthe Event tab, I put [Membership Change Date] = Now in the
OnEnter
event.

Now, when I tab into the field, I get an error saying that Microsoft
Access
can't find the macro [Membership Change Date] = Now . I've also tried
various combinations of spacing, leaving off the [] and Now() instead of
Now.

Suggestions?

TIA,

Glenn

:

gglazer,
Use the OnEnter event for the control...
[YourControlName] = Now
Whenever you enter the field, or tab through it, it will be updated
with
the latest Date and Time.
hth
Al Camp

I have a field in which I would like to record the date a change is made
to
a
record. I have such a time/date field, formatted like this:

dd mmm yyyy hh:nn:ss

The default value is =Now() . What I want is to have Access immedately
change the value of the field to the current date and time every time I
tab
through the field on the form. Suboptimally, is there a short hand
method
for entering the current time and date without explicitly typing the
whole
thing in?

TIA,

Glenn
 
Top