INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: To: RhinoBanga - Transfering Data From Forms1 To 2  (Read 1552 times)

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20063
To: RhinoBanga - Transfering Data From Forms1 To 2
« 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?
Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio, Music
https://MyAAGrapevines.com
https://centercitybbs.com
Fayetteville, NC, USA

RhinoBanga

  • Citizen of the Universe
  • *****
  • Posts: 1703
  • Developer
RE:To: RhinoBanga - Transfering Data From Forms1 To 2
« Reply #1 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
Logged

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20063
RE:To: RhinoBanga - Transfering Data From Forms1 To 2
« Reply #2 on: August 19, 2002, 05:24:07 am »

Does that sample work with a listbox?

if so i will try it later.
Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio, Music
https://MyAAGrapevines.com
https://centercitybbs.com
Fayetteville, NC, USA

RhinoBanga

  • Citizen of the Universe
  • *****
  • Posts: 1703
  • Developer
RE:To: RhinoBanga - Transfering Data From Forms1 To 2
« Reply #3 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.
Logged

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20063
RE:To: RhinoBanga - Transfering Data From Forms1 To 2
« Reply #4 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.
Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio, Music
https://MyAAGrapevines.com
https://centercitybbs.com
Fayetteville, NC, USA
Pages: [1]   Go Up