Click to See Complete Forum and Search --> : Data grid


qiaojun
August 13th, 2001, 12:04 PM
Is it possible to put a data combo into the datagrid's cell? How to do that?

Iouri
August 13th, 2001, 12:17 PM
'Reference: Microsoft ActiveX Data Objects 2.5 Library

'Place this section at top of form
Private WithEvents rsADOSetRecord As ADODB.Recordset
Private adoDataGrid As ADODB.Connection

Private Sub sbLoadCombo()
Set adoDataGrid = New ADODB.Connection
Set rsADOSetRecord = New ADODB.Recordset
With rsADOSetRecord
.Open "SELECT DISTINCT " & strFiledName & " FROM " & strTableName, adoDataGrid, , , adAsyncFetch
If Not .BOF Then
.MoveFirst
Do While Not .EOF
If .Fields(0).Value <> vbNull Then combo1.AddItem .Fields(0).Value
.MoveNext
Loop
End If
.Close
End With
End Sub


Iouri Boutchkine
iouri@hotsheet.com