INTERACT FORUM

Windows => Plug-in Development => Topic started by: KingSparta on August 18, 2002, 05:09:34 am

Title: To: RhinoBanga - Transfering Data From Forms1 To 2
Post by: KingSparta on August 18, 2002, 05:09:34 am
When Writing A A Recursive File Search Sub On A Form2 I Tryed To Transfer This Data From Form2.List1 To Form1.List1. The Problem Is I Never Tried This Before And I Could Never Get It To Work.

I Know How To Do It For TextBoxes

Any Tips On How To Do This Or If It Can Be Done For A ListBox?
Title: RE:To: RhinoBanga - Transfering Data From Forms1 To 2
Post by: RhinoBanga on August 18, 2002, 10:03:08 pm
Just load the form in the background but don't show it ... then you will have access to the members, e.g.

'  Declare the form holder
Dim myForm2 as Form2

'  Now create the form
Set myForm2 = new Form2

'  Fill the data
myForm2.txtValue = "ABC"

'  Now it's populated, show it
myForm2.Show vbModal, me


Similar but better than above is that after the "new" just call a form function passing in yourself and get the form to copy in the data it requires, e.g.:



'  Declare the form holder
Dim myForm2 as Form2

'  Now create the form
Set myForm2 = new Form2

'  Fill the data
myForm2.PopulateMyself( me )

'  Now it's populated, show it
myForm2.Show vbModal, me
Title: RE:To: RhinoBanga - Transfering Data From Forms1 To 2
Post by: KingSparta on August 19, 2002, 05:24:07 am
Does that sample work with a listbox?

if so i will try it later.
Title: RE:To: RhinoBanga - Transfering Data From Forms1 To 2
Post by: RhinoBanga on August 19, 2002, 05:48:44 am
No ... that just shows how you pass object X to object Y.

Why are you copying the data?

Why not just pass the Listbox to your search routine then you only have to keep the data once.
Title: RE:To: RhinoBanga - Transfering Data From Forms1 To 2
Post by: KingSparta on August 19, 2002, 07:00:19 am
well.

right now everything is on form1, so i am fine.

but, i was in form1, [Search]

Command_Search_Click() >>> -> form2

In form2 do all the search, fill up the listbox in form2 then when the user is done, [EXIT] >>>---> Pass List info to form1 listbox

Are You Saying:

when doing the search do not add the "New Info" to the form2 listbox add it to the form1.list1?

form1.list1.additem (new info to add to listbox)

I did not think of this and it may work.