locked
Form code changes on its own! RRS feed

  • Question

  • No, I am not crazy.  This code has worked for 3 years with out an issue.

    The code should read:

     strAccount_No = CLMain.txtAccount_No.Text

    But instead it reads:

     strAccount_No = FosterTrak_CLMain.txtAccount_No.Text

    CLMain is a form. The code is located on another form which gets data from the CLMain form.  The code is fine for the other forms such as FPMain. 

    The code suddenly changed today when I was working on something unrelated and when I change it back it reverts to iback to FosterTrak_CLMain.txtAccount_No.text.

    I have no idea what I did wrong.  Help would be appreciated.

    Jeff

     Public Function GetAccountNo()
    
            Select Case strReportName.ToLower
    
                Case "app contact note", "app contact notes", "app adopt checklist", "app cert approval", "app profile", "app percert", "trnhist app"
                    strAccount_No = AppMain.txtAcct_No2.Text
    
                Case "cl docs", "cl contact note", "cl contact notes", "soc160"
                    strAccount_No = FosterTrak_CLMain.txtAccount_No.Text
    
                Case "cl current", "fp contact note", "fp contact notes", "fp docs", "fp cert approval", "fp history fp", "fp profile", "prog detail"
                    strAccount_No = FPMain.txtFAcct2.Text
    
                Case "cw history cl", "fp history cl", "loc history", "off history", "cl profile", "sw history cl"
                    strAccount_No = FosterTrak_CLMain.txtAccount_No.Text
    
                Case "cw history cur", "cw history all"
                    strAccount_No = CWMain.txtCAcct.Text
    
                Case "sw history cur", "sw history all"
                    strAccount_No = SWMain.txtSAcct.Text
    
    
    
            End Select
            Return strAccount_No
        End Function



    ISV using VB.net and SQL Server

    Monday, October 5, 2020 8:28 PM

Answers

  • Hi Jeff07,

    Thank you for posting here.

    Based on your question, I suggest that you can delete the txtAccount_No.Text and create a new textbox.

    Then try to use the code:

    strAccount_No = CLMain.textbox1.Text

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Jeff07 Wednesday, October 7, 2020 3:03 PM
    Wednesday, October 7, 2020 3:20 AM

All replies

  • Hi

    What do you have releated to the 'FosterTrak' part of the code - I mean, it is not possible for anything to spontaneously change by itself.  Do the changes happen as you are entering/editting  the code line(s) where these changes occur?Is the Intellisence that is doing it>

    Are you sure you actually have a Form named CLMain?


    Regards Les, Livingston, Scotland


    • Edited by leshay Monday, October 5, 2020 8:49 PM
    Monday, October 5, 2020 8:49 PM
  • Yes I do.  FosterTrak is the name of the project.

    I made a change to the code else where in the program like I have done dozens of times.  When I went to run the project, it would not compile because of this code line.

    strAccount_No = FosterTrak_CLMain.txtAccount_No.Text

    Specifically, FosterTrak_CLMain is not  valid.  Very strange.  Maybe I will post a video of the code changing.


    ISV using VB.net and SQL Server

    Monday, October 5, 2020 9:48 PM
  • Hi

    OK, I can't imagine why such am odd thing is happening. Sorry, but maybe somene else has ideas.


    Regards Les, Livingston, Scotland

    Monday, October 5, 2020 10:26 PM
  • Not sure what I did.

    How do I fix it?

    Jeff


    ISV using VB.net and SQL Server

    Monday, October 5, 2020 10:31 PM
  • Hi Jeff07,

    Thank you for posting here.

    Based on your question, I suggest that you can delete the txtAccount_No.Text and create a new textbox.

    Then try to use the code:

    strAccount_No = CLMain.textbox1.Text

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Jeff07 Wednesday, October 7, 2020 3:03 PM
    Wednesday, October 7, 2020 3:20 AM