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

auto update

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a

<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 discussion thread is closed

Replies have been disabled for this discussion.