Hey Strongm,
I started with the DataGrid, but my problem is that I don't want to use the ADODC control to dump the whole table into the Grid and then move from one record to another. Since I wanted the results in the grid to appear based on the user entered key, I'm not sure how I can use my own code to control how my grid should get populated.
With MSFLEXGRID I used the following code to popluate my grid. Hey Andrjezek - This what you were also asking me, right? I've looked at your code yet, but I'll and respond back to you.
This part for populating the FLEXGRID is working fine for me.
Private Sub cmdNext_Click()
On Error GoTo errHandler
Dim Con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim sQuery As String
Dim vbResult As Integer
Con.Open DB_CONN, DB_USER, DB_PASS
sQuery = "select c1, d1 from <Table1>
where c1 = '" & Trim(txtC1Num.Text) & "'"
Set rs = Con.Execute(sQuery)
If Not rs.EOF Then
Call SelectRecordDC(rs)
Else
MsgBox "There are no records that match your search", vbExclamation
Exit Sub
End If
rs.Close
Set rs = Nothing
Con.Close
Set Con = Nothing
Exit Sub
Function SelectRecordDC(ByVal rs As Recordset) As Boolean
Dim sColumns(2) As String
Dim n As Integer
sColumns(0) = "County Precinct"
sColumns(1) = "District Combo"
Dim nRow As Integer
Dim nCol As Integer
Dim nField As Integer
MSHFDistrictCombo.Cols = 2
nRow = 0
nCol = 0
MSHFDistrictCombo.Row = nRow
For n = 0 To 1
MSHFDistrictCombo.Col = n
MSHFDistrictCombo.Text = sColumns

Select Case n
Case 0
MSHFDistrictCombo.ColWidth

= 1250
Case 1
MSHFDistrictCombo.ColWidth

= 1200
End Select
Next n
Do While Not rs.EOF
nRow = nRow + 1
MSHFDistrictCombo.Rows = nRow + 1
nCol = 0
MSHFDistrictCombo.Row = nRow
MSHFDistrictCombo.Col = nCol
MSHFDistrictCombo.Text = nRow
For nCol = 1 To MSHFDistrictCombo.Cols Step 1
MSHFDistrictCombo.Col = (nCol - 1)
MSHFDistrictCombo.Text = IIf(IsNull(rs(nCol - 1)), "", rs(nCol - 1))
Next
rs.MoveNext
Loop
SelectRecord = True
End Function
Thanks,
PS