Fields Updating Message - Page 4
Attend Excelapalooza
Thanks Thanks:  0
Likes Likes:  0
Page 4 of 4 FirstFirst ... 234
Results 31 to 39 of 39

Thread: Fields Updating Message

  1. #31
    Board Regular
    Join Date
    May 2013
    Posts
    294
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Fields Updating Message

     
    That is what I would expect as you are overwriting the string each time.
    I told you that in a previous post.

    Once again

    Code:
    strMsg = strMsg & "- " & ctl.ControlSource & vbCrLf
    You will have a - at the start, but let's get it working first.
    Excel 2007

  2. #32
    Board Regular
    Join Date
    Jan 2013
    Posts
    252
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Fields Updating Message

    welshgasman,

    I already have that string working. I've said that multiple times already. The message box will appear with only one field mentioned that it was updated instead of all fields that have been updated.

    I don't understand where I'm confusing you

  3. #33
    Board Regular
    Join Date
    May 2013
    Posts
    294
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Fields Updating Message

    Sorry I give up.
    Excel 2007

  4. #34
    MrExcel MVP
    Moderator
    xenou's Avatar
    Join Date
    Mar 2007
    Location
    Clev. OH, USA
    Posts
    15,763
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)

    Default Re: Fields Updating Message

    Code:
    If ctl.OldValue <> ctl.Value Then strMsg = "- " & ctl.ControlSource & vbCrLf
    you need to append each field each time, so it should be:
    Code:
    If ctl.OldValue <> ctl.Value Then strMsg = strMsg & " - " & ctl.ControlSource & vbCrLf

    Using: Office 2010/Win7 (work) Office 2010/Win7 (home)

    You are rich in proportion to the number of things you can let alone.
    -- Henry David Thoreau

  5. #35
    Board Regular
    Join Date
    Jan 2013
    Posts
    252
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Fields Updating Message

    I see it now, lol. So sorry. I've been working on very little sleep for a while now and the codes were looking the same to me.

    Thanking for pointing out the difference, xenou.

    My apologies welshgasman. This is what you've been saying. Sorry for the frustration I've caused.

  6. #36
    Board Regular
    Join Date
    Jun 2015
    Location
    Ontario, Canada
    Posts
    1,489
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Fields Updating Message

    Sorry that I have't been able to keep up. I'm away on vacation. Thanks xenou for pitching in. Re
    Please explain how I'm supposed to be going through the code step by step using F8.
    Some keyboards behave differently than others. When you were told to do that, the expectation would be that your cursor would be positioned in the code on an executable line (the very first would be best), and by pressing F8, the procedure would begin to execute, but only one line at a time for each F8 keypress. Given that the problem may be the lack of concatenation as pointed out by xenou, that may not have proved anything, but at least we would have been able to move off of the suggestion. As for the object or with block variable error message, it is one of those 'not very helpful messages' that you'll get. When it involves an object problem, it an be because an error has caused the object property, or the object itself, to cease to be available. Most often I find it results from your code trying to make use of an object that hasn't been declared, which indicates that the code writer may not have Object Explicit at the top of the modules.

    Be that as it may, the idea of stepping through code, by whatever means, is a powerful method of exposing errors. If you can't see the value of a variable, or if an object actually exists, by mousing over the relevant piece of code, you can at least check it in the immediate window while the code is suspended.

  7. #37
    Board Regular
    Join Date
    May 2013
    Posts
    294
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Fields Updating Message

    Quote Originally Posted by MHamid View Post
    I see it now, lol. So sorry. I've been working on very little sleep for a while now and the codes were looking the same to me.

    Thanking for pointing out the difference, xenou.

    My apologies welshgasman. This is what you've been saying. Sorry for the frustration I've caused.
    No worries, at least you have now got the message. :D
    I believe you need to study on how to debug VBA code. That will help you tremendously on errors like these.
    It's a godsend for my errors. :D
    Excel 2007

  8. #38
    MrExcel MVP
    Moderator
    xenou's Avatar
    Join Date
    Mar 2007
    Location
    Clev. OH, USA
    Posts
    15,763
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)

    Default Re: Fields Updating Message

    Essential Debugging skills explained here:
    http://krgreenlee.blogspot.com/2006/...gging-for.html

    Using: Office 2010/Win7 (work) Office 2010/Win7 (home)

    You are rich in proportion to the number of things you can let alone.
    -- Henry David Thoreau

  9. #39
    Board Regular
    Join Date
    Jan 2013
    Posts
    252
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Fields Updating Message

      
    Thank you, xenou. That was going to be my next question

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com