473,395 Members | 1,677 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,395 software developers and data experts.

Populate Date Automatically in Access Form

mmect
6
I'm working on a very basic form and need to know how to add a current date to a field (modified_recommendation) when another field is changed (recommendation). Please let know how i can do this. Currenltly, I have the following code in my database (OnCurrent and AfterUpdate)...the problem i'm having is that the date gets populated after the records is opened + when the code's in the Afterupdate part of the recommendation field, it does work.

Expand|Select|Wrap|Line Numbers
  1. Private Sub recommendation_AfterUpdate()
  2.  
  3.     Me![recommendation_modified] = Now()
  4.  
  5. End Sub
Mar 2 '07 #1
4 3409
MSeda
159 Expert 100+
you just need to take the code out of the on current event. the on current event is cause the date to change before any changes are made.
Mar 3 '07 #2
NeoPa
32,556 Expert Mod 16PB
MSeda's absolutely right.
I would add that, unless you do want the time element included in the field, you should use Date() instead of Now().
Mar 5 '07 #3
mmect
6
I changed the code a bit (added Date() and took the code out of On Current) and it worked great. Thanks for your help!
Mar 5 '07 #4
NeoPa
32,556 Expert Mod 16PB
Very pleased to hear it :)
It's impressive how well things can work when an OP follows the instructions exactly (That's a compliment btw ;)).
Nice work MSeda for spotting the main flaw.
And nice avatar to the OP.
Mar 5 '07 #5

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

Similar topics

4
by: Kevin H | last post by:
Apologies in advance if this sounds slow-witted, but I didn't find it here. Need to populate some textboxes on a form. While I could hard code it (the number of options aren't that high), it...
4
by: William Bradley | last post by:
I have two cells on a form. One of them is the "Production Date" and the other is the "Expiry Date". The "Expiry Date" is 183 days after the "Production Date." On an Excel spreadsheet, the...
2
by: Chand | last post by:
Hello Everyboy I am creating a small scale db with following fields in the table and form for the data entry purpose. Product ID Product Name Manufacturer Location 101 ...
29
by: gedwards | last post by:
First off, I am a complete newbie to Access. I've used it maybe a half dozen times, all my database knowledge is with Oracle. I'm building a database/form in Access 2003. I'm trying to get it so...
5
by: joshua.nicholes | last post by:
I have an access database that consists of two tables.A data collection table and a species list table. The data collection table has about 1500 records in it and the species list has about 600....
4
by: Nate | last post by:
I am looking to populate a Schedule table with information from two other tables. I am able to populate it row by row, but I have created tables that should provide all necessary information for me...
4
by: scolivas | last post by:
I think this is a me thing. but can't remember how to do it. I have a form that I am using and would like for a txt box to automatically populate based on what is selected in a combo box. here...
5
by: giandeo | last post by:
Hello Experts. Could you find a solution for this problem please! I have the following tables in Access Database Table Name: origin Fields Names: country, countrycode Table Name: make...
2
by: Ronald | last post by:
I hope somebody can help. I can't get into the specifics of my project, but I'll try to create a simple example: tblVehicle * VIN (text box) * Make (text box) * Model (text box) frmRepair
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.