none
Date time fields not updateing when saving RRS feed

  • Question

  • I am filling in defaults on a data entry form. This form is divided into two part the top is the operators shift log in times. The bottom is where they add information about the machines they are running. When the user Clicks the Add Printer button I populate most of the fields with default values. Login and logout times are copied from the shift data on the top of the form. I also fill out Status,  From, and Beginning Meter from the database. On the next image you can see I have added "Vario Printer 1" and all the information except End Meter has been filled in for the user. I click the update button and then view the data just before the update you will see on the third screen print (6178 VP1 at the bottom) all but the Login and Logout times are populated correctly. The only difference I can see the rest of the fields are textbox controls these two controls are DateTimePickers. Is there something I am doing wrong or something I missed to get these fields to update?

        Private Sub btnUpdatePrt_Click(sender As Object, e As EventArgs) Handles btnUpdatePrt.Click
    
            Me.Validate()
            Me.Shift_LogBindingSource.EndEdit()
            Me.Shift_PrintersBindingSource.EndEdit()
    
            Me.TableAdapterManager.UpdateAll(Me.LazerMaintenanceDataSet)
    
        End Sub



     
    Thursday, August 1, 2019 3:05 PM

Answers

  • Alex, no my problem is not solved. This appears to be a bug in Visual Studios Windows forms Development software. Since Microsoft is not supporting Windows forms development platform any longer I assume it will just continue to be a issue. My final work around is to just update the Binding source myself when the user saves the record. I will just leave this here for prosperity.

            Me.Shift_PrintersBindingSource.Current("SP_LogIn_Date") = dtpSP_LogIn_Date.Value
            Me.Shift_PrintersBindingSource.Current("SP_LogOut_Date") = dtpSP_LogOut_Date.Value


    Wednesday, August 7, 2019 1:13 PM

All replies

  • Hello Seeker of Wisdom,

    This forum is for "Discuss general issues about developing applications for Windows." It is win32/c++ focused.

    Since this issue is Visual Basic related I'll move it to Visual Basic forum for more professional support.

    Best regards,

    Rita


    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.

    Friday, August 2, 2019 1:53 AM
  • The most made mistake made in this is that the "Text" property is bound instead of the "Value" property.

    Success
    Cor

    Friday, August 2, 2019 10:24 AM
  • Thank you, I don't want to sound ungrateful. I guess I didn't see the C++ tag. The question is regarding the behavior of a certain controls. I selected Windows Desktop Development\General Windows Desktop Development Issues. This is a Windows desktop application, developed in Visual studio 2015. The question is a general question. I am not sure where I could discern only C++ questions. I assume you are a moderator so is it possible you are moderating the wrong thread? There are a couple options for C++ but it is not the one I selected. Thank you again
    Friday, August 2, 2019 3:15 PM
  • Cor, I checked they are bound to the value property. I got a tip from Kyle a while back that is working. If I disable and enable the field before call the update it forces the screen buffer to update the program buffer. Its a hokie work around but its working for now. 

    Friday, August 2, 2019 3:29 PM
  • Hi,

    Is your problem solved? If so, please mark the useful replies as answers.  

    Best Regards,

    Alex


    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.

    Wednesday, August 7, 2019 7:39 AM
  • Alex, no my problem is not solved. This appears to be a bug in Visual Studios Windows forms Development software. Since Microsoft is not supporting Windows forms development platform any longer I assume it will just continue to be a issue. My final work around is to just update the Binding source myself when the user saves the record. I will just leave this here for prosperity.

            Me.Shift_PrintersBindingSource.Current("SP_LogIn_Date") = dtpSP_LogIn_Date.Value
            Me.Shift_PrintersBindingSource.Current("SP_LogOut_Date") = dtpSP_LogOut_Date.Value


    Wednesday, August 7, 2019 1:13 PM
  • Alex, no my problem is not solved. This appears to be a bug in Visual Studios Windows forms Development software. Since Microsoft is not supporting Windows forms development platform any longer I assume it will just continue to be a issue.

    I don't think so. 

    Probably you have bound the wrong bindingsource (you have the same field in your datagridview and in a datetimepicker or calendar).

    But you give little information beside that you tell that others make mistakes. But not you.

    Who told you that Microsoft is not supporting windows forms anymore? AFAIK is that nowhere written.

    The only thing is Microsoft already 17 years stopped extending this part of Windows. However, for instance WPF has still endless calls to Windows Forms. 

    Success
    Cor


    Wednesday, August 7, 2019 3:08 PM
  • Cor, I certainly don't want to seem ungrateful and I do appreciate you help. I understand that you believe this is "my problem". And I admit I do make stupid mistakes from time to time. Besides who ever heard of a bug in MS Visual Studios. You are right I do have fields bound to both the DGV and the Form controls. They have distinctive names so as I do not make the mistake of binding the wrong field. Having a DGV to allow the user navigate through records is a common practice. Basically any beginner class will show you how its done. I don't believe its a either\or thing. I believe you can bind with both. A am only updating with one. But I have seen forms where you could update from both. I have checked my code and as you can see on the image above the control is bound to the correct field in the bindingsource. I am using VB.net not WPF despite MS claims that WPF is the end all be all. I have been writing applications since 1997 (22 years) and have seen many of MS "end all be all" fall by the way side. I have tried WPF and am not convinced it is any better than Windows Forms. As you say it still uses many of the same controls and events. I spent 2 or 3 years in the 90's ping ponging between Fox Pro and Access. Where is FoxPro? I could give you a list of MS epic fails. I'm sure you remember Vista, lol. As to Microsoft support, the last few bugs I have submitted have gotten the response "We are unable to comply because we are attending to other issues of benefit to a greater number of users". So how you can say MS is still supporting Windows Forms development? 


    Wednesday, August 7, 2019 8:09 PM