Why I got Error # 2950 when setting up a Modified Date field via Macro?

lookingforK

Registered User.
Local time
Today, 00:03
Joined
Aug 29, 2012
Messages
48
I want to create a [Modified Date] field as a time-stamp.

I followed the steps mentioned @ office.microsoft.com/en-us/access-help/store-the-date-and-time-when-a-record-is-modified-HA010241284.aspx.
1) Add the [Modified Date] field to a table
2) Create a macro that records the date
2.1) On the Create tab, in the Other group, click Macro.
2.2) On the Design tab, in the Show/Hide group, click Show All Actions.
2.3) In the first empty row of the Action column, select SetValue.
2.4) At the bottom of the design window, under Action Arguments, in the Item box, type [Modified Date].
2.5) In the Expression box, type Date().
2.6) Save As: Last Modified.

But, when I ran the macro, I got the following error:
"Microsoft Access can't find the name 'Modified Date' you entered in the expression.
You may have specified a control that wasn't on the current object without specifying the correct form or report context. To refer to a control on another form or report, precede the control name with the name of a collection, usually either Forms or Reports, and the name of the form or report to which the control belongs.For example, Forms![Products]![Units In Stock]."

How to deal with it?

Thank you in advance.
 
I'm surprised that in the tutorial Microsoft is using a field name that contains a space.

Anyway, if you have already created the field in the table all you need to do is:

1. Delete what's in the Before Udpate box in the form's Property Sheet
2. Click the elipsis button > select Code Builder > hit OK
3. Enter the following code in the cursor:
Code:
Me.[Modified Date] = Now()
If you only want just a date to be saved, change Now() to Date()
 

Users who are viewing this thread

Back
Top Bottom