Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Jul 2005
    Location
    Pennsylvania, USA
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    auto update of a field (Access 2000)

    I have a entry/edit form with a field list from a query. I have a date field that I want to be updated one of 2 ways. Either by manually entering a date in the field, or having it automatically updated with the current date if a percent field has an entered value of 100. I tried this function:

    IIf([lngPercentComp]=

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

    Re: auto update of a field (Access 2000)

    You can do this in a form bound to the query. The exact code depends on how the percentage reaches 100. If it is a value entered by the user, put code in the After Update event of the text box bound to lngPercentComp:

    Private Sub lngPercentComp_AfterUpdate()
    If Me.lngPercentComp = 100 Then
    Me.dtmFinishDate = Date
    End If
    End Sub

    If the percentage is calculated, you must put similar code in the After Update event of all controls that contribute to the result of the calculation. The lngPercentage text box itself should be bound to the field of the same name.

  3. #3
    Lounger
    Join Date
    Jul 2005
    Location
    Pennsylvania, USA
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: auto update of a field (Access 2000)

    Thanks Hans. Problem solved. I guess I wasn't as close as I thought. It's becoming apparent to me that I should be expanding my somewhat limited VB skills if I want to develop in Access efficiently. I understand the logic; it's the syntax I need to learn.

    Thanks again for your help and the usual fast response.

Posting Permissions

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