Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Jul 2006
    Posts
    96
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Updating a field based on the value of another (2003)

    Hi guys, sorry I'm keeping you busy today! I used to know how to pass a value to one field based on the value of another but it's sunk into the mists of time. I'm trying to update a field with a value of -1 (true) if another field is not null. I'm trying to do this via a VBA after update event but failing miserably (using an IIf statement, it keeps on asking me to put in an "=", where there already is one...). Can you help??

    Thanks muchly. Ina

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Updating a field based on the value of another (2003)

    Code would look like this (with the appropriate names substituted):

    Private Sub Field1_AfterUpdate
    If Not IsNull(Me.Field1) Then
    Me.Field2 = True
    End If
    End Sub

  3. #3
    Star Lounger
    Join Date
    Jul 2006
    Posts
    96
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Updating a field based on the value of another (2003)

    Thanks as always - this site is a great help to us learners.

    Ina

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •