Jump to content
Xtreme .Net Talk

dswigart

Members
  • Posts

    4
  • Joined

  • Last visited

Personal Information

  • .NET Preferred Language
    VB.Net

dswigart's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I changed the code in the MDI form to: Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem1.Click Dim employees As New frmEmployees() employees.Dispose() Employees = New frmEmployees() Employees.MdiParent = Me Employees.Show() End Sub now it doesn't work the first time I enter the form. In several ways I've seen so far.... VB6 was much easier to use than VB.NET
  2. Unfortunately that didn't work. Dave
  3. The sql is in the properties for the data adapter. The first time that the form is called there is no problem. It only gives a problem on the second load. As if it were trying to make a duplicate connection. The step through just stops me on the first "fill" statement.
  4. I have a problem figuring out how to get from VB6 to VB.Net when it comes to Parent / Child Forms. From what I can tell, I have to create the form and then create an instance of it. This is what I have done: Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem1.Click Dim Employees As New frmEmployees() Employees.MdiParent = Me Employees.Show() End Sub The form has 3 sql connections and several DataSets. The default connection strings are set for each sql data adapter. When the child form loads the following sub is run: Private Sub frmEmployees_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Loaded = False Call LoadTables() ComboBox1.SelectedIndex = 1 RadioButton1.Checked = True Loaded = True End Sub 'frmEmployees_Load The first few lines of PRIVATE SUB LoadTables are: Private Sub LoadTables() DsEmployees1.Clear() DsCopy21.Clear() DsCopy31.Clear() DsAllDeductions1.Clear() DsAllEarnings1.Clear() DsRegRep1.Clear() DsRegRep21.Clear() sdaFedMStatus.Fill(DsCopy21) When I exit the Child form the following code is executed: Private Sub frmEmployees_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing Try SqlConnection1.Close() Catch End Try SqlConnection1.Dispose() MsgBox(ChangedMain) End Sub 'frmEmployees_Closing HERE'S MY PROBLEM. When I close the Child form and try to reaccess it from the Parent I get an error on the line "sdaFedMStatus.fill(DsCopy21). The error says: The SelectCommand property has not been initiallized before calling "Fill WHY DOES THIS ERROR HAPPEN ON THE SECOND CALL OF THE FORM AND NOT ON THE FIRST? HOW DO I CORRECT THIS PROBLEM.:confused:
×
×
  • Create New...