|
-
Sep 15th, 2003, 04:37 AM
#1
Thread Starter
Lively Member
Datagrid to another form
Hi, i got a few records displaying in a datagrid. Then if i clicked on one of the record, it should show another form displaying all the respective data in the textbox.
How do i pass the parameters to the next form?
-
Sep 15th, 2003, 07:17 AM
#2
Fanatic Member
In the form that you want to show - add parameters in the New constructor and then you can pass them in.
-
Sep 15th, 2003, 08:22 AM
#3
Sleep mode
Or
Declare an array in a module then assign it values from your form (data form) , then you can use in the entire proj .
-
Sep 15th, 2003, 09:50 PM
#4
Thread Starter
Lively Member
I dun really understand, can u pls show mi some examples..
-
Sep 16th, 2003, 09:13 AM
#5
Sleep mode
OK in a module declare this global variable and change number the index of the array to match the number of your actuall data saved to it :
VB Code:
Public Values(3) As String
then , in your first form , assign the values to the array elements consecutively as follow :
VB Code:
Values(0) = "item1"
Values(1) = "item2"
Values(2) = "item3"
Values(3) = "item4"
lastly , since all data reserved in the array and you can call it from anywhere within your proj , call this array from your second form and assign values to textboxes or whatever you will use as so :
VB Code:
TextBox1.Text = Values(0)
TextBox2.Text = Values(1)
TextBox3.Text = Values(2)
TextBox4.Text = Values(3)
I hope this helps .
-
Sep 16th, 2003, 08:23 PM
#6
Thread Starter
Lively Member
Thanks, but the datagrid is read from the database one lei. How to set the value?
-
Sep 16th, 2003, 08:44 PM
#7
Sleep mode
Try this something like this :
VB Code:
Values(0) = DataGrid1.Item(0, 0) ' First row , first column
Values(1) = DataGrid1.Item(0, 1) ' First row , second column
Values(2) = DataGrid1.Item(0, 2) ' First row , third column
Values(3) = DataGrid1.Item(0, 3) ' First row , forth column
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|