I'm trying to using the following bit of code to fill a flexgrid but get an error stating that the ReDraw is invalid use of property. Can someone please enlighten me why.
Code:
Private Sub btnShowAll_Click()
Set rs = New ADODB.Recordset
rs.ActiveConnection = cn
rs.Source = "SELECT * FROM tblNewSearch ORDER BY SurName"
rs.CursorLocation = adUseClient
rs.CursorType = adOpenDynamic
rs.LockType = adLockOptimistic
rs.Open
Set MSFlexGrid1.DataSource = rs
MSFlexGrid1.Redraw
End Sub
Private Sub Form_Load()
Set cn = New ADODB.Connection
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=..\TCRDataSplit.mdb;"
cn.Open
End Sub
Private Sub Form_Unload(Cancel As Integer)
rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing
End Sub