MDI Parent / child form Vb.net

The code below works perfectly when applying it to a "normal" form. If i try to use the same code with a "child" form, it never loads the combobox. Basically i need to know if there is any difference when working with mdi parent and child and regular form. Why does the code work when using a regular form and not when it is a child form.

Thanks

Dim rs As ADODB.Recordset
        Dim MyArray As New ArrayList
        Dim State As SigMap.net_Logic.Common

        'On Error GoTo EH

        rs = New ADODB.Recordset
        State = New SigMap.net_Logic.Common
        rs = State.GetStates

        LoadCombobox(rs, MyArray, "description", "id")

        CropCalcLoss.cmbCrop.DataSource = MyArray

        CropCalcLoss.cmbCrop.DisplayMember = "description"
        CropCalcLoss.cmbCrop.ValueMember = "id"

        rs.Close()

        Exit Sub

EH:
        Err.Description = "LoadStates-> " & Err.Description
        Err.Raise(Err.Number, Err.Source, Err.Description)
virgilarAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TertioptusCommented:
where do you add the combo box to it's parent form's "Controls" collection?
0
KudzullcCommented:
virgilar,

Is this VB6 code?  I thought .NET go away from recordsets?
     

        Dim cnOleDb As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\")
        Dim drB2B As OleDb.OleDbDataReader


        cnOleDb.Open()
        Dim cmdB2BCust As New OleDb.OleDbCommand("SELECT * FROM Customers WHERE ID = " & CustIDTextBox.Text & "", cnOleDb)
        drB2B = cmdB2BCust.ExecuteReader
        While drB2B.Read Then
                ParentForm.cmbCrop.Items.Add(drB2B.GetValue(drB2B.GetOrdinal("name")).ToString)        
        End While
        cnOleDb.Close()

This is a .NET approach to building MDI parents with the child form.  Useing OleDb to query data for a fill.

Hope this helps!

Lucas
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
KudzullcCommented:
virgilar,

Thanks!  Did this resolve your issue?

Lucas
0
virgilarAuthor Commented:
Yes, it did. I am still trying to make the transition between vb 6.0 and .net. Good solution, thanks.

Andre
0
KudzullcCommented:
Great!

Thanks, again.

Lucas
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.