Back again...
My MSHFlexGrid has the following in it (adapted from MS's example)
For my connection I have...
As I understand things, when I click on a record, open another form, then close that form, the "cn.CursorLocation" should take me back to the record I clicked on in the Grid. Am I correct in this? However this does not happen, it goes back to the first record at the top of the grid.
My "FillGrid" function will refresh the grid and loose my record setting when the form is activate again (resizing), correct?
I call this function to refill the grid with data after a search.
If my assumptions are correct then how can I get the grid to highlight the row I orginally clicked so I can see where I was? (bugger bookmarks are not supported)
TIA
cheers
Howard
My MSHFlexGrid has the following in it (adapted from MS's example)
Code:
Private Sub Form_Resize()
MSHFlexGrid1.Top = 1300
MSHFlexGrid1.Left = 50
MSHFlexGrid1.Visible = True
If Me.Height > 2600 Then
MSHFlexGrid1.Height = Me.Height - 2600
End If
If Me.Width > 200 Then
MSHFlexGrid1.Width = Me.Width - 200
End If
MSHFlexGrid1.Clear
MSHFlexGrid1.TopRow = 1
MSHFlexGrid1.Rows = 2
MSHFlexGrid1.Cols = 9
Call GetHeaders
Call FillGrid
MSHFlexGrid1.ColWidth(0) = 0
MSHFlexGrid1.ColWidth(1) = 0
MSHFlexGrid1.ColWidth(2) = MSHFlexGrid1.Width / 4.8
MSHFlexGrid1.ColWidth(3) = MSHFlexGrid1.Width / 4
MSHFlexGrid1.ColWidth(4) = MSHFlexGrid1.Width / 15
MSHFlexGrid1.ColWidth(5) = MSHFlexGrid1.Width / 10
MSHFlexGrid1.ColWidth(6) = MSHFlexGrid1.Width / 2.8
MSHFlexGrid1.ColWidth(7) = 0
MSHFlexGrid1.ColWidth(8) = 0
If frmNamesList.Width < 10890 Then frmNamesList.Width = 10890
End Sub
Sub FillGrid()
MSHFlexGrid1.Clear
MSHFlexGrid1.Visible = False
MSHFlexGrid1.Rows = 2
MSHFlexGrid1.TopRow = 1
MSHFlexGrid1.FixedRows = 1
MSHFlexGrid1.Cols = Rs.Fields.Count
Call GetHeaders
If ShowRecs Then
Set MSHFlexGrid1.DataSource = Rs
End If
MSHFlexGrid1.Visible = True
End Sub
Private Sub GetHeaders()
MSHFlexGrid1.TextMatrix(0, 2) = "Surname"
MSHFlexGrid1.TextMatrix(0, 3) = "First Name"
MSHFlexGrid1.TextMatrix(0, 4) = "ListType"
MSHFlexGrid1.TextMatrix(0, 5) = "Event Date"
MSHFlexGrid1.TextMatrix(0, 6) = "Register"
End Sub
For my connection I have...
Code:
Sub rs_Connector()
Set Cn = New ADODB.Connection
Cn.CursorLocation = adUseClient
Cn.Mode = adModeRead
Cn.Open "Provider=Microsoft.Jet.Oledb.4.0;Data Source=..\TCRDataSplit.mdb"
End Sub
As I understand things, when I click on a record, open another form, then close that form, the "cn.CursorLocation" should take me back to the record I clicked on in the Grid. Am I correct in this? However this does not happen, it goes back to the first record at the top of the grid.
My "FillGrid" function will refresh the grid and loose my record setting when the form is activate again (resizing), correct?
I call this function to refill the grid with data after a search.
If my assumptions are correct then how can I get the grid to highlight the row I orginally clicked so I can see where I was? (bugger bookmarks are not supported)
TIA
cheers
Howard