It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Visual Basic Forum

Transfer variable's value from TBDGrid (in form1) to form2

Moderator: dafunkymunky

Transfer variable's value from TBDGrid (in form1) to form2

Postby gazavous on Sun Oct 05, 2008 8:23 pm

I use Visual Basic 6

I declare PUBLIC vnbt as interger, in SubMain.
I put a value to vnbt=adodc1.recorset.item(0) when a dblclick() proc.
is used in the TDBGrid, in the form1 (choose one of the many items in the grid).
In dblClick proc., the last line programming is form2.show
In this form, the first time, the value is correct.
But when I return in form1 with form2.hide and I choose another item in the TBDGrid, the first value still in memory.

I named a label with the value of variable on the form1 and when I make a dblclick, the good value showed in form1 and the first value stay for the form2.

Can you help me on this problem ?

Thank's :) [/b][/code]
gazavous
 
Posts: 2
Joined: Sun Oct 05, 2008 1:47 pm
Location: québec, canada

Postby mbshinde78 on Tue Oct 14, 2008 11:10 am

Hi,

Can you show us the code please from both of the forms?

May be it will help us better understand.
mbshinde78
 
Posts: 16
Joined: Tue Sep 09, 2008 1:07 pm

Postby gazavous on Tue Oct 14, 2008 4:54 pm

I know now why the variable vnbt didn't change every time :

I used "Load" procedure rather the "Activate" procedure in the form2.

The first was ok but not after.

Now with activate procedure, every time, the value of vnbt is ok.

Thank's
gazavous
 
Posts: 2
Joined: Sun Oct 05, 2008 1:47 pm
Location: québec, canada


Who is online

Users browsing this forum: No registered users and 3 guests