Can't find msgbox code (Deleted it) but msgbox still appears












0















I haven't even been able to find anyone with this problem online, let alone a solution!



I had several msgboxes in some VBA code I was writing to provide feedback for debugging. After a while the code was stable and I commented out the MsgBox lines.



One set of msgboxes wouldn't vanish though. I even deleted it rather than removing it. In the end I decided I must have a duplication somewhere, somehow, even though all the related code ended up calling this specific function where I'd removed the MsgBox.



I couldn't see any other explanation as I'd literally deleted the lines of code. I searched the entire project for fragments of the string which formed part of the MsgBox's text. Ctrl + F, set to search entire project, tried with and without pattern matching.



I found literally nothing. I decided the string must be more constructed than I thought, and instead opted to search using 'MsgBox' to search through every time I had used the command. I checked every single MsgBox in every project file and found nothing even remotely like the debugging message the code was still generating.



Anyone have any other ideas what may be going on? My best theory is that I've somehow hidden or duplicated something, but aside from depreciating a form whose code doesn't contain a single MsgBox or call code which does, I've done nothing I can think of to cause this.



I'd paste the code but you'd still just be taking my word for it that the MsgBox isn't there.



Can anyone help? It has to be hiding in there somewhere, somehow.



Many thanks,



Code where the MsgBox originally appeared (it provided feedback based on the RecordSet's NoMatch property):



Public Function createRecordSnapshot(Table As String, dbRefIn As String, payNum As String)


Dim fieldNames As String
Dim oldDataSet As String
Dim rs As Recordset
Dim fieldCount As Integer
Dim recordTot As Integer
Dim srchString As String


Set rs = CurrentDb.OpenRecordset(Table, dbOpenDynaset)
srchString = "DBRef = '" & dbRefIn & "' and PayrollRef = '" & payNum & "'"
fieldCount = rs.Fields.Count
rs.FindFirst (srchString)
Dim o As Integer

For o = 0 To fieldCount - 1
fieldNames = fieldNames & rs.Fields(o).Name & "|"
Next o

For o = 0 To fieldCount - 1
oldDataSet = oldDataSet & rs.Fields(o).Value & "|"
Next o

createRecordSnapshot = fieldNames & vbNewLine & oldDataSet

End Function









share|improve this question

























  • MsgBox's don't just show up without code triggering them so it's clearly in the code somewhere...without showing us any of the code we aren't going to be able to help you.

    – user1011627
    Nov 20 '18 at 15:38











  • Given I've already removed it from the code section it appeared in I don't see how it will help. I need a way to find wherever it is hiding. If it will help though, the code was originally here providing feedback as to the NoMatch property of the record set:

    – Evis03
    Nov 20 '18 at 15:42











  • Maybe VBA is calling a macro and it has MessageBox Macro Action?

    – Dávid Laczkó
    Nov 20 '18 at 15:46











  • @DávidLaczkó, None that I can find with a ctrl+F, search entire project search. There isn't a whole lot of code present either.

    – Evis03
    Nov 20 '18 at 15:48











  • Try after re-compilation of the code (in the Debug menu there is an option to compile)

    – Dávid Laczkó
    Nov 20 '18 at 15:58
















0















I haven't even been able to find anyone with this problem online, let alone a solution!



I had several msgboxes in some VBA code I was writing to provide feedback for debugging. After a while the code was stable and I commented out the MsgBox lines.



One set of msgboxes wouldn't vanish though. I even deleted it rather than removing it. In the end I decided I must have a duplication somewhere, somehow, even though all the related code ended up calling this specific function where I'd removed the MsgBox.



I couldn't see any other explanation as I'd literally deleted the lines of code. I searched the entire project for fragments of the string which formed part of the MsgBox's text. Ctrl + F, set to search entire project, tried with and without pattern matching.



I found literally nothing. I decided the string must be more constructed than I thought, and instead opted to search using 'MsgBox' to search through every time I had used the command. I checked every single MsgBox in every project file and found nothing even remotely like the debugging message the code was still generating.



Anyone have any other ideas what may be going on? My best theory is that I've somehow hidden or duplicated something, but aside from depreciating a form whose code doesn't contain a single MsgBox or call code which does, I've done nothing I can think of to cause this.



I'd paste the code but you'd still just be taking my word for it that the MsgBox isn't there.



Can anyone help? It has to be hiding in there somewhere, somehow.



Many thanks,



Code where the MsgBox originally appeared (it provided feedback based on the RecordSet's NoMatch property):



Public Function createRecordSnapshot(Table As String, dbRefIn As String, payNum As String)


Dim fieldNames As String
Dim oldDataSet As String
Dim rs As Recordset
Dim fieldCount As Integer
Dim recordTot As Integer
Dim srchString As String


Set rs = CurrentDb.OpenRecordset(Table, dbOpenDynaset)
srchString = "DBRef = '" & dbRefIn & "' and PayrollRef = '" & payNum & "'"
fieldCount = rs.Fields.Count
rs.FindFirst (srchString)
Dim o As Integer

For o = 0 To fieldCount - 1
fieldNames = fieldNames & rs.Fields(o).Name & "|"
Next o

For o = 0 To fieldCount - 1
oldDataSet = oldDataSet & rs.Fields(o).Value & "|"
Next o

createRecordSnapshot = fieldNames & vbNewLine & oldDataSet

End Function









share|improve this question

























  • MsgBox's don't just show up without code triggering them so it's clearly in the code somewhere...without showing us any of the code we aren't going to be able to help you.

    – user1011627
    Nov 20 '18 at 15:38











  • Given I've already removed it from the code section it appeared in I don't see how it will help. I need a way to find wherever it is hiding. If it will help though, the code was originally here providing feedback as to the NoMatch property of the record set:

    – Evis03
    Nov 20 '18 at 15:42











  • Maybe VBA is calling a macro and it has MessageBox Macro Action?

    – Dávid Laczkó
    Nov 20 '18 at 15:46











  • @DávidLaczkó, None that I can find with a ctrl+F, search entire project search. There isn't a whole lot of code present either.

    – Evis03
    Nov 20 '18 at 15:48











  • Try after re-compilation of the code (in the Debug menu there is an option to compile)

    – Dávid Laczkó
    Nov 20 '18 at 15:58














0












0








0








I haven't even been able to find anyone with this problem online, let alone a solution!



I had several msgboxes in some VBA code I was writing to provide feedback for debugging. After a while the code was stable and I commented out the MsgBox lines.



One set of msgboxes wouldn't vanish though. I even deleted it rather than removing it. In the end I decided I must have a duplication somewhere, somehow, even though all the related code ended up calling this specific function where I'd removed the MsgBox.



I couldn't see any other explanation as I'd literally deleted the lines of code. I searched the entire project for fragments of the string which formed part of the MsgBox's text. Ctrl + F, set to search entire project, tried with and without pattern matching.



I found literally nothing. I decided the string must be more constructed than I thought, and instead opted to search using 'MsgBox' to search through every time I had used the command. I checked every single MsgBox in every project file and found nothing even remotely like the debugging message the code was still generating.



Anyone have any other ideas what may be going on? My best theory is that I've somehow hidden or duplicated something, but aside from depreciating a form whose code doesn't contain a single MsgBox or call code which does, I've done nothing I can think of to cause this.



I'd paste the code but you'd still just be taking my word for it that the MsgBox isn't there.



Can anyone help? It has to be hiding in there somewhere, somehow.



Many thanks,



Code where the MsgBox originally appeared (it provided feedback based on the RecordSet's NoMatch property):



Public Function createRecordSnapshot(Table As String, dbRefIn As String, payNum As String)


Dim fieldNames As String
Dim oldDataSet As String
Dim rs As Recordset
Dim fieldCount As Integer
Dim recordTot As Integer
Dim srchString As String


Set rs = CurrentDb.OpenRecordset(Table, dbOpenDynaset)
srchString = "DBRef = '" & dbRefIn & "' and PayrollRef = '" & payNum & "'"
fieldCount = rs.Fields.Count
rs.FindFirst (srchString)
Dim o As Integer

For o = 0 To fieldCount - 1
fieldNames = fieldNames & rs.Fields(o).Name & "|"
Next o

For o = 0 To fieldCount - 1
oldDataSet = oldDataSet & rs.Fields(o).Value & "|"
Next o

createRecordSnapshot = fieldNames & vbNewLine & oldDataSet

End Function









share|improve this question
















I haven't even been able to find anyone with this problem online, let alone a solution!



I had several msgboxes in some VBA code I was writing to provide feedback for debugging. After a while the code was stable and I commented out the MsgBox lines.



One set of msgboxes wouldn't vanish though. I even deleted it rather than removing it. In the end I decided I must have a duplication somewhere, somehow, even though all the related code ended up calling this specific function where I'd removed the MsgBox.



I couldn't see any other explanation as I'd literally deleted the lines of code. I searched the entire project for fragments of the string which formed part of the MsgBox's text. Ctrl + F, set to search entire project, tried with and without pattern matching.



I found literally nothing. I decided the string must be more constructed than I thought, and instead opted to search using 'MsgBox' to search through every time I had used the command. I checked every single MsgBox in every project file and found nothing even remotely like the debugging message the code was still generating.



Anyone have any other ideas what may be going on? My best theory is that I've somehow hidden or duplicated something, but aside from depreciating a form whose code doesn't contain a single MsgBox or call code which does, I've done nothing I can think of to cause this.



I'd paste the code but you'd still just be taking my word for it that the MsgBox isn't there.



Can anyone help? It has to be hiding in there somewhere, somehow.



Many thanks,



Code where the MsgBox originally appeared (it provided feedback based on the RecordSet's NoMatch property):



Public Function createRecordSnapshot(Table As String, dbRefIn As String, payNum As String)


Dim fieldNames As String
Dim oldDataSet As String
Dim rs As Recordset
Dim fieldCount As Integer
Dim recordTot As Integer
Dim srchString As String


Set rs = CurrentDb.OpenRecordset(Table, dbOpenDynaset)
srchString = "DBRef = '" & dbRefIn & "' and PayrollRef = '" & payNum & "'"
fieldCount = rs.Fields.Count
rs.FindFirst (srchString)
Dim o As Integer

For o = 0 To fieldCount - 1
fieldNames = fieldNames & rs.Fields(o).Name & "|"
Next o

For o = 0 To fieldCount - 1
oldDataSet = oldDataSet & rs.Fields(o).Value & "|"
Next o

createRecordSnapshot = fieldNames & vbNewLine & oldDataSet

End Function






access msgbox






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 20 '18 at 15:49







Evis03

















asked Nov 20 '18 at 15:30









Evis03Evis03

104




104













  • MsgBox's don't just show up without code triggering them so it's clearly in the code somewhere...without showing us any of the code we aren't going to be able to help you.

    – user1011627
    Nov 20 '18 at 15:38











  • Given I've already removed it from the code section it appeared in I don't see how it will help. I need a way to find wherever it is hiding. If it will help though, the code was originally here providing feedback as to the NoMatch property of the record set:

    – Evis03
    Nov 20 '18 at 15:42











  • Maybe VBA is calling a macro and it has MessageBox Macro Action?

    – Dávid Laczkó
    Nov 20 '18 at 15:46











  • @DávidLaczkó, None that I can find with a ctrl+F, search entire project search. There isn't a whole lot of code present either.

    – Evis03
    Nov 20 '18 at 15:48











  • Try after re-compilation of the code (in the Debug menu there is an option to compile)

    – Dávid Laczkó
    Nov 20 '18 at 15:58



















  • MsgBox's don't just show up without code triggering them so it's clearly in the code somewhere...without showing us any of the code we aren't going to be able to help you.

    – user1011627
    Nov 20 '18 at 15:38











  • Given I've already removed it from the code section it appeared in I don't see how it will help. I need a way to find wherever it is hiding. If it will help though, the code was originally here providing feedback as to the NoMatch property of the record set:

    – Evis03
    Nov 20 '18 at 15:42











  • Maybe VBA is calling a macro and it has MessageBox Macro Action?

    – Dávid Laczkó
    Nov 20 '18 at 15:46











  • @DávidLaczkó, None that I can find with a ctrl+F, search entire project search. There isn't a whole lot of code present either.

    – Evis03
    Nov 20 '18 at 15:48











  • Try after re-compilation of the code (in the Debug menu there is an option to compile)

    – Dávid Laczkó
    Nov 20 '18 at 15:58

















MsgBox's don't just show up without code triggering them so it's clearly in the code somewhere...without showing us any of the code we aren't going to be able to help you.

– user1011627
Nov 20 '18 at 15:38





MsgBox's don't just show up without code triggering them so it's clearly in the code somewhere...without showing us any of the code we aren't going to be able to help you.

– user1011627
Nov 20 '18 at 15:38













Given I've already removed it from the code section it appeared in I don't see how it will help. I need a way to find wherever it is hiding. If it will help though, the code was originally here providing feedback as to the NoMatch property of the record set:

– Evis03
Nov 20 '18 at 15:42





Given I've already removed it from the code section it appeared in I don't see how it will help. I need a way to find wherever it is hiding. If it will help though, the code was originally here providing feedback as to the NoMatch property of the record set:

– Evis03
Nov 20 '18 at 15:42













Maybe VBA is calling a macro and it has MessageBox Macro Action?

– Dávid Laczkó
Nov 20 '18 at 15:46





Maybe VBA is calling a macro and it has MessageBox Macro Action?

– Dávid Laczkó
Nov 20 '18 at 15:46













@DávidLaczkó, None that I can find with a ctrl+F, search entire project search. There isn't a whole lot of code present either.

– Evis03
Nov 20 '18 at 15:48





@DávidLaczkó, None that I can find with a ctrl+F, search entire project search. There isn't a whole lot of code present either.

– Evis03
Nov 20 '18 at 15:48













Try after re-compilation of the code (in the Debug menu there is an option to compile)

– Dávid Laczkó
Nov 20 '18 at 15:58





Try after re-compilation of the code (in the Debug menu there is an option to compile)

– Dávid Laczkó
Nov 20 '18 at 15:58












1 Answer
1






active

oldest

votes


















0














After a modification it is good practice to re-compile the code manually, as it makes running the code faster (can skip the compilation on next run) and refreshes previously compiled code. The option is in the VB Editor's Debug menu.






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53396355%2fcant-find-msgbox-code-deleted-it-but-msgbox-still-appears%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    After a modification it is good practice to re-compile the code manually, as it makes running the code faster (can skip the compilation on next run) and refreshes previously compiled code. The option is in the VB Editor's Debug menu.






    share|improve this answer




























      0














      After a modification it is good practice to re-compile the code manually, as it makes running the code faster (can skip the compilation on next run) and refreshes previously compiled code. The option is in the VB Editor's Debug menu.






      share|improve this answer


























        0












        0








        0







        After a modification it is good practice to re-compile the code manually, as it makes running the code faster (can skip the compilation on next run) and refreshes previously compiled code. The option is in the VB Editor's Debug menu.






        share|improve this answer













        After a modification it is good practice to re-compile the code manually, as it makes running the code faster (can skip the compilation on next run) and refreshes previously compiled code. The option is in the VB Editor's Debug menu.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 20 '18 at 16:16









        Dávid LaczkóDávid Laczkó

        429128




        429128






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53396355%2fcant-find-msgbox-code-deleted-it-but-msgbox-still-appears%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            'app-layout' is not a known element: how to share Component with different Modules

            android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

            WPF add header to Image with URL pettitions [duplicate]