By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,122 Members | 921 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,122 IT Pros & Developers. It's quick & easy.

Using a subroutine to populate a field in Access - how to tie to field?

P: n/a
I have a subroutine I want to run whenever an Access record is
updated.

Sub Form_BeforeUpdate(Cancel As Integer)
Me!LastUpdated = Now
End Sub

It updates this date field with the current date whenever a record is
changed. How do I tie this sub to the field in Access, so that it
fires on change?

Thanks.


bp
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Access does not have triggers, so you cannot achieve this at the
table-level.

The code you have is the right approach, provided all changes are made
through the form.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Blake Patterson" <bl***@blakespot.com> wrote in message
news:90**************************@posting.google.c om...
I have a subroutine I want to run whenever an Access record is
updated.

Sub Form_BeforeUpdate(Cancel As Integer)
Me!LastUpdated = Now
End Sub

It updates this date field with the current date whenever a record is
changed. How do I tie this sub to the field in Access, so that it
fires on change?

Nov 12 '05 #2

P: n/a
bl***@blakespot.com (Blake Patterson) wrote in message news:<90**************************@posting.google. com>...
I have a subroutine I want to run whenever an Access record is
updated.

Sub Form_BeforeUpdate(Cancel As Integer)
Me!LastUpdated = Now
End Sub

It updates this date field with the current date whenever a record is
changed. How do I tie this sub to the field in Access, so that it
fires on change?

Thanks.


if you want the date the *Field's* value was last changed, then put it
in the AfterUpdate of the field's control.
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.