473,320 Members | 2,202 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to fill the "LastUpdate" field automatically?

Hi,

I have two fields in my Table - "ID" and "LastUpdate" and i want the "LastUpdate" field to be updated with the current date and time whenever i make any changes to the field "ID" or add a new ID. Can someone kindly support me with this?
I am extremely new to MS Access and have a poor VB knowledge hence, would be great if someone can give me a detailed process...

Sheela
Dec 21 '09 #1
3 1655
MikeTheBike
639 Expert 512MB
Hi

Assuming that the records are added and updated in a Form then
perhaps something like this
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_BeforeUpdate(Cancel As Integer)
  2.     [LastUpdate]=Now()
  3. End Sub
??


MTB
Dec 21 '09 #2
Hi Mike,

thanks for the quick reply.. however I update the ID directly into the table and not by using forms.
Dec 23 '09 #3
missinglinq
3,532 Expert 2GB
Then you're out of luck! Data should never be entered directly into a table!

Go to Forms in the database window, click on Create form by using Wizard and follow the Wizard's instruction to create a form based on your table. Then, from Form Design View, go to the View Menu and click on Code. Paste in Mike's code and you should be set.

Welcome to Bytes!

Linq ;0)>
Dec 23 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: droope | last post by:
I am trying to create a proc with a parm @whereclause that will have a value passed in of one to many policy ids. The parm coming into the proc looks like this, ('000000000108', '000000000106',...
0
by: Rob | last post by:
Access Gurus, This script was used to view the reports on the web by choosing a date on or before the current day.Recently it stopped working and i am not able to figure where the problem is. ...
1
by: Rob | last post by:
Access Gurus, This script was used to view the reports on the web by choosing a date on or before the current day.Recently it stopped working and i am not able to figure where the problem is. ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.