Computing.Net > Forums > Office Software > Access: Update date after editing

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Access: Update date after editing

Reply to Message Icon

Name: Dane
Date: March 9, 2006 at 19:02:15 Pacific
OS: XP Pro Media Centre
CPU/Ram: Pentium D / 512
Product: Medion
Comment:

I have a customer database of names, addresses, etc.
One field is called LastContact. This is a date field which is automatically filled in with the current date **only when the record is first added to the database**.
I often update e.g. the email field of records and then I manually update the LastContact field to the current date, which is quite time consuming when I need to update 120 email-addresses or ordering information fields per week.
Does anyone have a trick how the LastContact field can be automatically updated to the current date when I change any field of that particular record ? With that I mean only that record should be date-updated, not the whole database.
I would reeeeally appreciate "instructions for idiots" because I'm not all that familiar with Access's formulas, macros etc. and would have no idea where to add what. (I do know where the BeforeUpdate and AfterUpdate input lines for the Datum field is though)

Many thanks !



Sponsored Link
Ads by Google

Response Number 1
Name: mdow
Date: March 10, 2006 at 05:45:00 Pacific
Reply:

In the After Update Event you want to add code like this.

If (IsNull([LastContact]) Or [LastContact] < Date) Then
LastContact = Date
End If

The After Update event apllies this to the edited record not the whole table.


0

Response Number 2
Name: Dane
Date: March 10, 2006 at 14:32:50 Pacific
Reply:

Many thanks for your help.

Sorry for my ignorance but when I right click on the LastContact field.. Properties.. TextBox:LastContact..Events..
do I simply enter the code directly into the area on the right of the After Update line, or do I need to click the dropdown arrow and select from Expression Builder / Macro Builder / Code Builder ?

It doesn't change anything when I enter the code as it is, nor when I use the Code builder and insert the lines between "Private Sub LastContact_AfterUpdate()" and "End Sub".

I've tried editing a record then clicking Save, as well as editing a record then going to the next or previous record, but the LastContact field is still not changing :-(



0

Response Number 3
Name: mdow
Date: March 13, 2006 at 05:26:57 Pacific
Reply:

Use the code builder. You should use the Form properties not the text box.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Office Software Forum Home


Sponsored links

Ads by Google


Results for: Access: Update date after editing

Microsoft Office Access and merge www.computing.net/answers/office/microsoft-office-access-and-merge-/1402.html

Access Query & Dates www.computing.net/answers/office/access-query-amp-dates/2667.html

Outlook 2K OLE Registration error www.computing.net/answers/office/outlook-2k-ole-registration-error/1477.html