Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2011

    Question Unanswered: set an indicator if the data value of a field on the form has changed

    I am developing a series of forms and tables that the user can set the parameters for loading reports. I am using a tabbed subform method for organizing the steps. At step 5 the user has provided enough information to be able to review the client list. Creating the client list requires running multiple queries and is not instantaneous. I would like to be able to set an indicator if the data value of a field on the form has changed and trigger the running of the client list queries from this indicator. Is this possible? Do I use the change event? Is it a public or private sub or function? This is the direction I was heading but I am new to programming (very good at modifying what others have written but do not do so well at writing from scratch) and I am not sure what to do with this or if I am on the correct path.

    Public Sub CXGSrvcMnth_Change()
    On Error GoTo Err_CXGSrvcMnth_Change
    'Set a Boolean to identify when the CXGSrvcMnth field value has changed
    Dim SrvcMnthChange As Boolean
    SrvcMnthChange = True ‘Do I set this to False and then do a Set to True?
    What is next? How do I use this in later modules?

    Exit Sub
    MsgBox Err.Number & " - " & Err.Description, vbOKOnly, "Error Setting Change Indicator for Time Frame"
    Resume Exit_CXGSrvcMnth_Change
    End Sub

  2. #2
    Join Date
    May 2010
    I would use the After Update event.

    Also you will need to move this line:

    Dim SrvcMnthChange As Boolean

    so that is if available outside the sub. Currently the way you have it Dim'ed it is only available within the sub.

    You might want to move it to a code module and change uit to be have a global scope.
    Boyd Trimmell aka HiTechCoach (free access stuff)
    Microsoft MVP - Access Expert
    BPM/Accounting Systems/Inventory Control/CRM
    Programming: Nine different ways to do it right, a thousand ways to do it wrong.
    Binary--it's as easy as 1-10-11

Tags for this Thread

Posting Permissions

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