|
-
Feb 14th, 2008, 11:42 AM
#1
Thread Starter
Addicted Member
DataGrid Help
Hello guys ,
I am new to here... I need the output as shown below... So please edit my code according to the output.
My code:
Code:
Dim r As ADODB.Recordset
Private Sub Form_Load()
Set r = New ADODB.Recordset
With r.Fields
.Append "First name", adBSTR
.Append "Second name", adBSTR
.Append "Third name", adBSTR
End With
r.Open
r.AddNew 0, "Siva"
r.AddNew 1, "Chand"
r.AddNew 2, "SivaChand"
Set DataGrid1.DataSource = r
End Sub
For the above code output:
First name Second name Third name
Siva
Chand
Sivachand
But i want the output like this:
First name Second name Third name
Siva Chand Sivachand
test1 test2 test3
Please help me to make this change..... Advance thx....
-
Feb 14th, 2008, 11:49 AM
#2
Re: DataGrid Help
Welcome to the forums. 
What are you outputting it to?
-
Feb 14th, 2008, 11:56 AM
#3
Re: DataGrid Help
Try,
Code:
r.Addnew
r![first name] = "siva"
r![second name] = "Chand"
r![third name] = "sivachand"
r.Update
-
Feb 14th, 2008, 11:57 AM
#4
Thread Starter
Addicted Member
Re: DataGrid Help
Above code fill the datagrid in diagonal [ie (0,0) (1,1) (2,2) (3,3)....] cell only. But i want to fill all the cells [ ie (0,0) (0,1) (0,2) (0,3)....]. For that what i do?
-
Feb 14th, 2008, 11:59 AM
#5
Thread Starter
Addicted Member
Re: DataGrid Help
 Originally Posted by wes4dbt
Try,
Code:
r.Addnew
r![first name] = "siva"
r![second name] = "Chand"
r![third name] = "sivachand"
r.Update
Thanks for your quick reply Wes4bt... Its helpful for me... Thanks once again
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
|