After update event

  • Thread starter Thread starter injanib via AccessMonster.com
  • Start date Start date
I

injanib via AccessMonster.com

Hello Access Monsters,

I want a code for the afterupdate event of one field that will set the value
of another field as the current date and time.
There are two fields, one for date and one for time. If the procedure uses
the (=now()) formula then I can adjust the input mask for both field, other
wise please tell me the code for both time and date fields.

Thanks fellas.
 
Microsoft Access offers a Date/Time data type. Is there a reason you are
trying to separate out date-values from time-values?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Hello Access Monsters,

I want a code for the afterupdate event of one field that will set the value
of another field as the current date and time.
There are two fields, one for date and one for time. If the procedure uses
the (=now()) formula then I can adjust the input mask for both field, other
wise please tell me the code for both time and date fields.

Thanks fellas.

You don't need separate Date and Time fields.

If the field is DateTime datatype, then:
[DateField] = Now()

will pass it the current date and time.

You then simply format the field as wanted.
Set the Format property of that field to something like:
General Date
or
mmm d, yyyy hh:nn:ss am/pm
or
Long Time
or
hh:nn
or
etc....
 
Awesome,

Just needed the code. I know the rest. You are the man.
Hello Access Monsters,
[quoted text clipped - 5 lines]
Thanks fellas.

You don't need separate Date and Time fields.

If the field is DateTime datatype, then:
[DateField] = Now()

will pass it the current date and time.

You then simply format the field as wanted.
Set the Format property of that field to something like:
General Date
or
mmm d, yyyy hh:nn:ss am/pm
or
Long Time
or
hh:nn
or
etc....
 
I know what you mean. There is no particular reason, except that the form is
laid out such that the date and time fields are far apart.

Jeff said:
Microsoft Access offers a Date/Time data type. Is there a reason you are
trying to separate out date-values from time-values?

Regards

Jeff Boyce
Microsoft Office/Access MVP
Hello Access Monsters,
[quoted text clipped - 7 lines]
Thanks fellas.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top