shovels
Apr 5th, 2000, 11:31 PM
Hi,
I'm using the following code to create and populate a felxgrid with information from an Access DB. Can anyone please tell me how to edit the code in order to make the Grid editable. i.e I want to be able to update the info in the Db Table from my form.
Any help or suggestions would be greatly appreciated.
cheers,
shovels
Set rs1 = New adodb.Recordset 'create recordset
rs1.Open "select * from AdministratorPasswords", conn, adOpenKeyset, adLockOptimistic 'populate rs with query result
mfgFlex1.Clear 'set grid layout at run-time
k = rs1.RecordCount
j = rs1.Fields.Count
mfgFlex1.Rows = k + 1
mfgFlex1.Cols = j + 1
With mfgFlex1
lngRow = 1
Do Until rs1.EOF
mfgFlex1.TextMatrix(0, 1) = "Username"
mfgFlex1.TextMatrix(0, 2) = "Password"
For lngCol = 0 To rs1.Fields.Count - 1
.TextMatrix(lngRow, lngCol + 1) = rs1(lngCol)
Next lngCol
rs1.MoveNext
lngRow = lngRow + 1
Loop
End With
I'm using the following code to create and populate a felxgrid with information from an Access DB. Can anyone please tell me how to edit the code in order to make the Grid editable. i.e I want to be able to update the info in the Db Table from my form.
Any help or suggestions would be greatly appreciated.
cheers,
shovels
Set rs1 = New adodb.Recordset 'create recordset
rs1.Open "select * from AdministratorPasswords", conn, adOpenKeyset, adLockOptimistic 'populate rs with query result
mfgFlex1.Clear 'set grid layout at run-time
k = rs1.RecordCount
j = rs1.Fields.Count
mfgFlex1.Rows = k + 1
mfgFlex1.Cols = j + 1
With mfgFlex1
lngRow = 1
Do Until rs1.EOF
mfgFlex1.TextMatrix(0, 1) = "Username"
mfgFlex1.TextMatrix(0, 2) = "Password"
For lngCol = 0 To rs1.Fields.Count - 1
.TextMatrix(lngRow, lngCol + 1) = rs1(lngCol)
Next lngCol
rs1.MoveNext
lngRow = lngRow + 1
Loop
End With