|
Answer» Dear Sir
Previously I used different objects like TextBox, Combobox, DTPicker etc. to fetch data from database under click event of a Command button and it is working. I have used DATAGRID and it is also working well.
Now want to use FlexGrid. I want to see same data synchronizing with FlexGrid and above mentioned objects i.e. TextBox, Combobox, DTPicker etc. under the click event of a command button. I have used below code but not working.
CODE: Private Sub Makeflex() Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\INVENTORY-NEW OFFICE.mdb;Persist SECURITY Info=False" Adodc1.RecordSource = "Select brand from tblpurchasesupplyqty" Set MSFlexGrid1.DataSource = Adodc1 DBconnect If rst.State = adStateOpen Then rst.Close rst.Open "tblpurchasesupplyqty", CNT, adOpenDynamic, adLockOptimistic If Not rst.BOF Then rst.MoveFirst With MSFlexGrid1 i = 1 While Not rst.EOF .Row = i .Col = 1 .Text = rst.Fields(0) .Col = 2 .Text = rst.Fields(1) .Col = 3 .Text = rst.Fields(2) .Col = 4 .Text = rst.Fields(3) .Col = 5 .Text = rst.Fields(4) .Col = 6 .Text = rst.Fields(5) .Col = 7 .Text = rst.Fields(6) rst.MoveNext i = i + 1 Wend End With End Sub
Please help.
Regards Pervez
|