Consulting

Results 1 to 6 of 6

Thread: After Update Event

  1. #1

    After Update Event

    I was wondering if there was a way to to trigger an after update event on any Control that was Selected. For example: All I would want to do is if a Control has a value changed by a user(after update event) I want the background Color of the Control to change. But lets say I have over a 100 Controls. I find it annoying that I would have to go through and add that modification to each "After Update Event" for each Control. There must be an easier way where you can past Control by reference.

  2. #2
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    The form itself has a Before and After Update Event, so if you used the Before Update you can identify the field that currently has "Focus" using the ActiveControl attribute.
    Like
    msgbox Me.ActiveControl.Name gives the name of the control.

  3. #3
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    .
    Last edited by OBP; 06-29-2017 at 07:37 AM. Reason: repeat post

  4. #4
    That I did not know about and I'm glad I know that know for the future stuff, but sadly after fooling around with it for about an hour, I'm just going to have to go through and create an event for every Control...Thanks!

  5. #5
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    What sort of code did you try?
    As this works
    Me.ActiveControl.BackColor = vbRed
    Changes the colour of the current active control.

  6. #6
    I could not get it to work the way I wanted, So I just spent 30min going through 270 controls adding an after update event to change the color, wasn't fun haha

Posting Permissions

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