473,327 Members | 2,081 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,327 software developers and data experts.

auto update

how can i make it so that when the value of one field is 15 another field in same record automatically enters todays date?
thanks in advance!!
Nov 13 '05 #1
3 2220
Do you want the second field to continue to update every time today's date
changes, as long as the value of the first field is 15?

Or do you want the second field to be updated only when the value of the
first field *changes* to 15?

- Turtle

<jj****@earthlink.net> wrote in message
news:ZC*****************@newsread2.news.pas.earthl ink.net...
how can i make it so that when the value of one field is 15 another field in same record automatically enters todays date? thanks in advance!!

Nov 13 '05 #2
Put the following code in the OnCurrent event of your form:
If Me!FieldA = 15 Then
Me!FieldB = Date()
Else
Me!FieldB = Null
End If

Also put the same code in the AfterUpdate event of FieldA.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
<jj****@earthlink.net> wrote in message
news:ZC*****************@newsread2.news.pas.earthl ink.net...
how can i make it so that when the value of one field is 15 another field in same record automatically enters todays date? thanks in advance!!

Nov 13 '05 #3

<jj****@earthlink.net> wrote in message
news:ZC*****************@newsread2.news.pas.earthl ink.net...
how can i make it so that when the value of one field is 15 another field in same record automatically enters todays date? thanks in advance!!


If you mean, automatically, in a table, without anything else happening, you
can't. Perhaps if you'd tell us a little more detail -- when do you want
this to happen, when you are entering data, or to records that already
exist, etc., we could be of more help.

If you are entering data in a form, in the AfterUpdate event of the Control
where the "15" would appear (call it txtTest) , you might code the following
to set today's date in another control (call it txtNewDate):

If Me!txtTest = 15 Then
Me!txtNewDate = Date()
End If

Larry Linson
Microsoft Access MVP

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Rene Aguirre | last post by:
Hello everybody, Recently I made a 'improvement' from an 'old' system we used for i2c bus testing as I had no access to the source code, I started from scratch on Python/wxPython. The idea...
0
by: Jerry Brenner | last post by:
Our users have potentially dirty legacy data that they need to get into our application. We provide a set of staging tables, which map to our source tables, that the users do their ETL into. ...
4
by: Shahar | last post by:
Hi I need to get a field name 'ID'(that is an auto-number field) right after I add a new row to table, it's work like that: myCommand.ExecuteNonQuery(); myCommand.CommandText = "SELECT...
6
by: Alpha | last post by:
I retrieve a table with only 2 columns. One is a auto-generated primary key column and the 2nd is a string. When I add a new row to the dataset to be updated back to the database. What should I...
1
by: ainsley | last post by:
Hi this is going to sound like a very basic question, but I am creating a database in Access which is based on a number of unlimited tables. In my data entry form i have a number of combo boxes...
15
by: Neo | last post by:
Hello All, I found that ASP.net website only accepts code withing site directory. This creates big hurdle in shairng code. How to share code between two websites, like the way share between two...
13
by: S.Dickson | last post by:
I had an access database that i use as an ordering system. I have a form for entering customer details. When i add a new customer on the form the customer number is an auto number that appears when...
0
by: Agnes | last post by:
I try the auto-update program from IIS - http://sourceforge.net/projects/appupdater It works find in window2003 However, when I do the same procedure and setup in window 2000 IIS 5.0 it is fail...
0
by: Agnes | last post by:
my server is WINDOW 2003 , When i process auto update , there is an error" "Application Update Failed" The auto-update of this application failed with the following error message: Download of a...
1
by: jimilives | last post by:
I forgot to turn on auto increment when I reinstalled this database and now I have a bunch of NULL values in my ID field for last few hundred inserts, how can I update this table to replace the NULLS...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.