Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

How can I do this? I'm trying like this:

 

Dim frm2 As New frm2()

 

frm2.BindingContext(objDataSet1, "MyTable").EndCurrentEdit()

frm2.BindingContext(objDataSet1, "MyTable").Position = Me.ListBox1.SelectedIndex

 

I've tried other things also, but I mean it must be somewhere around this.

 

I select a user from ListBox1. But when I open frm2, the index ist still at the first position.

 

I think it must be possible. Can anybody help me, please?

Posted

Thanks for the ideas. I have found another possibility now.

 

First I create a module:

 

Module SharedFormInstances

Public myForm1 As New Form1()

Public myForm2 As New Form2()

End Module

 

That gives me access from each form to each other form, without having to declare a lot of things.

 

Now in the sub form_load I have to declare only "myForm(x)=Me. And then the code goes:

 

Private Sub Form2_load (...)

myForm1=Me

Me.LoadDataSet()

Me.BindingContext(objDataSet1, "MyTable").EndCurrentEdit()

Me.BindingContext(objDataSet1, "MyTable").Position = myForm2.ListBox1.SelectedIndex

End Sub

 

Hope that helps anybody else also.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...