954,568 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Data Grid Help required

Hi All,
I want to use the data grid as input interface.
Can any one help how to start.
i need 3 columns date, name, location
the location field is drop down field user can select from the list only.
the values entered by user should update in the database.


your help is most appreciated :icon_wink:

Vijay

vijay.wadikar
Newbie Poster
4 posts since Oct 2007
Reputation Points: 10
Solved Threads: 1
 

Try binding the datagrid to a database table.

agrothe
Junior Poster
153 posts since Jun 2006
Reputation Points: 37
Solved Threads: 18
 

I don't want to bind it with control, other than this any thing:(

vijay.wadikar
Newbie Poster
4 posts since Oct 2007
Reputation Points: 10
Solved Threads: 1
 

just use datagrid1.textmatrix. .

ryan311
Posting Whiz in Training
254 posts since Jul 2008
Reputation Points: 3
Solved Threads: 5
 
I don't want to bind it with control, other than this any thing:(

Try using disconnected recordset, then apply the recordset to the database after editing.

Dim rst As New ADODB.Recordset
Dim xData(2, 1) As String
 
Private Sub Form_Load()
xData(0, 0) = "23"
xData(0, 1) = "Michael Jordan"
xData(1, 0) = "24"
xData(1, 1) = "Kobe Bryant"
xData(2, 0) = "33"
xData(2, 1) = "Grant Hill"
With rst
    .Fields.Append "idno", adInteger
    .Fields.Append "names", adVarChar, 30
    .CursorType = adOpenKeyset
    .Open
    For Index = 0 To UBound(xData)
        .AddNew
        .Fields("idno") = CInt(xData(Index, 0))
        .Fields("names") = xData(Index, 1)
        .Update
    Next
End With
Set DataGrid1.DataSource = rst
End Sub
agrothe
Junior Poster
153 posts since Jun 2006
Reputation Points: 37
Solved Threads: 18
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You