Huw Davies
New Member
- Joined
- Aug 26, 2005
- Messages
- 20
Can anyone give me simple instructions on how to put a grid control on an Access form and link it interactively with a query in the database. A small working example would be wonderful.
adapter = New OleDb.OleDbDataAdapter(sqlStatement, connection)
accessData = New DataTable("theData")
Dim ds As DataSet
ds = New DataSet("theData")
ds.Tables.Add(accessData)
dgResults.DataSource = ds
adapter.Fill(accessData)
'Clear any bindings from the DataGrid and set the DataSource of the DataGrid
'to the new excelData DataTable
dgResults.DataBindings.Clear()
dgResults.DataSource = accessData