Recording the date and time when modifying a record

J

jrussell3

I am trying to record the date when I check on a yes/no box on a form. I
created a macro to setvalue of date(). I selected the macro on the property
of the field on a form. THe Property was BeforeUpdate. I get an error
message that says "The Object doesn't contain the automation object. You
tried to use a VB procedure to set a property or method for an object.
However the component doesn't make the property or method available for
Automation operations. Check the component;s documentation for information
on the properties and methods it makes availavle for Automation operations."
I followed the instructions in help for recording the date, but I am getting
this error.
 
R

Rick B

No idea how to di it using macros. But with code, you'd just put code in
the before update event just put code...

If CheckBoxFieldName = -1 Then
SomeDateField = Now()
End IF
 
T

tina

well, i'd probably use the AfterUpdate event, because the BeforeUpdate event
can be cancelled. the macro should be on the checkbox's event, and it should
be updating a Date/Time field in the form's underlying table. use the
SetValue action in the macro, with the following Action Arguments, as

Item: MyDateFieldName
Expression: Date()

hth
 
Top