Results 1 to 7 of 7
  1. #1
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480

    on label caption change.... oh wait a min... Take a look

    I have a form that works with a ticket system. Every so many seconds (Timed event) my program scrubs the screen for a ticket number, this ticket number then is displayed in a label caption... meaning...

    Me.lblSDnum.Caption = SD
    and SD = a variable of IE elements, depending on the situation...
    this process is working very well, without issue.

    So I created another process (sub Checks), this will open another IE window to an account screen to verify certain services... This happens behind the scenes, and as a stand alone, working very well.

    I want this (sub checks) to run only when the value or caption of this label changes... meaning... if the rep is on one account.. and the label is displaying 123456... I want my code to run as soon as the timed even changes the label caption to 654321. I thought I would be able to have a "on change" or "after update" code fire off my sub... but with a label this does not appear to be an option.



    I could just have this sub run with the timed event, but that would be excessive and would end up causing a slow down in system speed. So I want the sub to run ONLY when lblSDnum caption changes... any ideas?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    In your timed event, test whether the existing caption is different than the variable before you set it, and run the other sub appropriately.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    Hmm... I am going to have to figure out how to do that... ... I understand / like the method... but the code bit is not hitting me...

    Currently...

    Code:
    Me.lblSDnum.Caption = SD
    
    and SD is...
    
    SD = otest.SD
    
    Otest is a class module that references a lot of different IE elements that tend to change depending on the situation
    Maybe have a invisible text box? this textbox has the value of lblsdnum, and I could tag an on change event to it to run the sub?? How would you program out your method?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Code:
    If Me.lblSDnum.Caption <> SD Then  
      Me.lblSDnum.Caption = SD
      Run Other Sub
    End If
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    alright, let me give this a shot

  6. #6
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480



    Works, thank you!

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    No problemo!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Change size of Label
    By amerifax in forum Access
    Replies: 1
    Last Post: 10-17-2012, 06:18 PM
  2. Saving Change to Text Caption During Run-time
    By Janoose in forum Programming
    Replies: 5
    Last Post: 05-27-2011, 01:38 PM
  3. Set Label.Caption to field of recordsource
    By ngruson in forum Forms
    Replies: 1
    Last Post: 08-11-2010, 09:59 AM
  4. Replies: 1
    Last Post: 03-24-2010, 02:25 PM
  5. Change of label size
    By Zoroxeus in forum Programming
    Replies: 0
    Last Post: 06-11-2007, 08:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums