Set current date upon update

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am having troubles setting a date/time field to the current date when i do
an update on a form. I used BeforeUpdate, and followed the directions on the
Assistant page for this topic, however it still does not work. Also i am
using a form with several subforms on it, when i do an update on one of these
forms will the date/time field reflect that a change has been? If anyone can
help it would be greatly appreciated. Thanks
 
What did you use?

Did you try on the before update event this code

Me.[DateFieldName] = Date()
 
I created a macro. I set the action to SetValue, set the item to the
date/time field, and used the expression Now(). The date/time field has an
input mask that will display the date only. i would prefer to use a macro, i
think this method is a little easier that using code. thanks

Ofer Cohen said:
What did you use?

Did you try on the before update event this code

Me.[DateFieldName] = Date()

--
Good Luck
BS"D


JKarchner said:
I am having troubles setting a date/time field to the current date when i do
an update on a form. I used BeforeUpdate, and followed the directions on the
Assistant page for this topic, however it still does not work. Also i am
using a form with several subforms on it, when i do an update on one of these
forms will the date/time field reflect that a change has been? If anyone can
help it would be greatly appreciated. Thanks
 
Try to avoid macro's in such metters, its easier with code, using Error
capture and to debug.
But for now
1. Open the form in design view
2. Open the properties (press Alt+Enter)
3. Select the form properties, press the left top corner of the form
4. Go to the before update property, locate the cursor in it, you'll see a
button on right with the three dots, press it and select code
5. In the code section write the code

Me.[DateFieldName] = Now()
=======================
Try it, in the end you'll find out that code it's actually easier then
macro's, and much more freindly



--
Good Luck
BS"D


JKarchner said:
I created a macro. I set the action to SetValue, set the item to the
date/time field, and used the expression Now(). The date/time field has an
input mask that will display the date only. i would prefer to use a macro, i
think this method is a little easier that using code. thanks

Ofer Cohen said:
What did you use?

Did you try on the before update event this code

Me.[DateFieldName] = Date()

--
Good Luck
BS"D


JKarchner said:
I am having troubles setting a date/time field to the current date when i do
an update on a form. I used BeforeUpdate, and followed the directions on the
Assistant page for this topic, however it still does not work. Also i am
using a form with several subforms on it, when i do an update on one of these
forms will the date/time field reflect that a change has been? If anyone can
help it would be greatly appreciated. Thanks
 
thank you very much.

Ofer Cohen said:
Try to avoid macro's in such metters, its easier with code, using Error
capture and to debug.
But for now
1. Open the form in design view
2. Open the properties (press Alt+Enter)
3. Select the form properties, press the left top corner of the form
4. Go to the before update property, locate the cursor in it, you'll see a
button on right with the three dots, press it and select code
5. In the code section write the code

Me.[DateFieldName] = Now()
=======================
Try it, in the end you'll find out that code it's actually easier then
macro's, and much more freindly



--
Good Luck
BS"D


JKarchner said:
I created a macro. I set the action to SetValue, set the item to the
date/time field, and used the expression Now(). The date/time field has an
input mask that will display the date only. i would prefer to use a macro, i
think this method is a little easier that using code. thanks

Ofer Cohen said:
What did you use?

Did you try on the before update event this code

Me.[DateFieldName] = Date()

--
Good Luck
BS"D


:

I am having troubles setting a date/time field to the current date when i do
an update on a form. I used BeforeUpdate, and followed the directions on the
Assistant page for this topic, however it still does not work. Also i am
using a form with several subforms on it, when i do an update on one of these
forms will the date/time field reflect that a change has been? If anyone can
help it would be greatly appreciated. Thanks
 
I am still having a problem. When i update information on one of the
subforms, the date does not update. How would i go about setting it up so
that upon a change on any of the subforms, the date/time field on the main
form will reflect that an update has been made?
 
Back
Top