auto update

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guest's Avatar

    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!!


  • MacDermott

    #2
    Re: auto update

    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

    <jjrmy1@earthli nk.net> wrote in message
    news:ZC8xc.6163 $uX2.3841@newsr ead2.news.pas.e arthlink.net...[color=blue]
    > how can i make it so that when the value of one field is 15 another field[/color]
    in same record automatically enters todays date?[color=blue]
    > thanks in advance!!
    >
    >[/color]


    Comment

    • PC Datasheet

      #3
      Re: auto update

      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
      resource@pcdata sheet.com



      <jjrmy1@earthli nk.net> wrote in message
      news:ZC8xc.6163 $uX2.3841@newsr ead2.news.pas.e arthlink.net...[color=blue]
      > how can i make it so that when the value of one field is 15 another field in[/color]
      same record automatically enters todays date?[color=blue]
      > thanks in advance!!
      >
      >[/color]


      Comment

      • Larry  Linson

        #4
        Re: auto update


        <jjrmy1@earthli nk.net> wrote in message
        news:ZC8xc.6163 $uX2.3841@newsr ead2.news.pas.e arthlink.net...[color=blue]
        > how can i make it so that when the value of one field is 15 another field[/color]
        in same record automatically enters todays date?[color=blue]
        > thanks in advance!![/color]

        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



        Comment

        Working...