Question Problem with running code when using tab control

josh2009

Member
Joined
Sep 16, 2009
Messages
14
Programming Experience
Beginner
Hi,

Newbie here. We have a purchased application written in Visual Studio 2005 that uses tab controls for displaying information. One of the tabs is for reporting and I am trying to run some code to enable a report component and disable a Validate button. It has a proprietary report component (LxReportView1) that is initially disabled. As user enters information, the Validate button is used to check for required fields. After data entries have been validated, user click Validate one last time and record gets flagged as validated and report component (LxReportView1) gets enabled for use. Ideally, whenever this Report tab is clicked, it will run my code EACH TIME. Here is my code -

VB.NET:
Private Sub CardioForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Me.SetStyle(System.Windows.Forms.ControlStyles.SupportsTransparentBackColor, True)
            If LxTextBoxValidated.Text = "Y" Then
                LxReportView1.Enabled = True
                LxButton1.ForeColor = Color.Black
                LxButton1.Enabled = False
            End If
        End Sub

Works fine when user's first action is to bring up a record that has already been validated. So when user clicks on Report tab, report component LxReportView1 has been enabled for use and the Validate button has been disable just as designed. Problem is that given a list of records, if user selects a record that has NOT been validated yet and then later on brings up another record that has been validated, code does not run. How can I get this code to run EACH and EVERY TIME the form loads. Any help will be greatly appreciated. Thanks
 
Back
Top