Fritz Posted October 12, 2002 Posted October 12, 2002 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? Quote
Moderators Robby Posted October 12, 2002 Moderators Posted October 12, 2002 Place a Property Get/Set in frm2, Set its' value before you open frm2 then in the New or Load of frm2 Get the Index from the Property. Quote Visit...Bassic Software
*Gurus* Derek Stone Posted October 12, 2002 *Gurus* Posted October 12, 2002 Alternatively, you could overload the form's constructor (New). Quote Posting Guidelines
Fritz Posted October 13, 2002 Author Posted October 13, 2002 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.