Ok, I have a txt box and when the textbox text changes its supposed to run an sql statement to fill the mshflexgrid. Which it does. BUT when you search more than once (without closing the frm in between)then click a line in the flexgrid to select a record it gives you the data for the line above the one you clicked...
Im thinking the mshflexgrid isnt resetting or something in between. I tried the refresh property, the redraw property, the clear & Clear structure properties, etc. I dont know what else I can do.
Here is my code to fill the mshflexgrid...
VB Code:
Dim sConnect As String Dim sSQL As String Dim dfwConn As ADODB.Connection Dim datPrimaryRs As New ADODB.Recordset 'set strings sConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='" & frmlocation.Text1.Text & "';Persist Security Info=False" sSQL = "select InsRecID, SpecID, Insurance, InsuranceID from DrsInsuranceList where SpecID like '" & Text7.Text & "'" ' open connection Set dfwConn = New ADODB.Connection dfwConn.Open sConnect 'create a recordset using the provided collection datPrimaryRs.CursorLocation = adUseClient datPrimaryRs.Open sSQL, dfwConn, adOpenForwardOnly, adLockReadOnly Set MSHFlexGrid1.DataSource = datPrimaryRs With MSHFlexGrid1 .ColWidth(0) = 250 .ColWidth(1) = 0 .ColWidth(2) = 1500 .ColWidth(3) = 1500 .ColWidth(4) = 1500 .ColAlignment(1) = 4 .ColAlignment(3) = 4 .ColAlignment(4) = 4 .ColAlignmentFixed = 4 .Row = 0 .Col = 2 .Text = "Specialist ID" .Col = 3 .Text = "Insurance" .Col = 4 .Text = "Insurance ID" End With
Ideas?




Reply With Quote