0

This is the code i am using for displaying data into the DataGrid,bt its not working,plz help

Set DataGrid1.DataSource = rs
If rs.EOF And rs.BOF Then
MsgBox "Invalid Entry", vbOKOnly, "Stop!!"
Exit Sub
End If
Do
DataGrid1.Columns(0).Caption = rs!PS_NO
DataGrid1.Columns(1).Caption = rs!Name
DataGrid1.Columns(2).Caption = rs!DT_PREP
DataGrid1.Columns(3).Caption = rs!ADV
DataGrid1.Columns(4).Caption = rs!NATURE_EXP
While rs.EOF
Wend
Loop

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by KSS
0

Hi,

You can change the caption from the properties of the control or if u want to do it by code then do it only once..
For example:

Datagrid1.Columns(0).Caption = "Surname"
Datagrid1.Columns(1).Caption = "Name"
....
....

The loop was not necessary.
Check the attachment file...

Good luck...

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.