Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Thanked 0 Times in 0 Posts

    for each (Access 2000)

    In the OnClose event of the form i want to put a code checking the field Me!afid for each row
    and if afid is null, to enter the following number:

    Me![afid] = Me![office]

    I think i will need a for line. How can i do it?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: for each (Access 2000)

    I would do this in the Before Update event of the form, not in the On Close event:

    Private Sub Form_BeforeUpdate(Cancel As Integer)
    If IsNull(Me.afid) Then
    Me.afid =
    End If
    End Sub

    To set this for existing records, you can create an update query and run it once.

Posting Permissions

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