Row hightlight / Automatic scrolldown-up
am 06.11.2007 18:22:33 von ANDRESUKHi,
I have a very simple way of highlighting the current row in a
continuous subform, and using up/down buttons on the form I'm able to
move the selected row up and down.
My question is;
As I move down out of the screen how can I automatically scroll down
to show the selected record.
The code I'm using works as follows;
1.) On the continuous form's header, I have a text box called [txtTmp]
showing the current record's Unique ID
2.) On the detail section of the form I have a field called
[txtORDER_ID] with a conditionalformatting = ( Field Value Is > equal
to > [txtTmp] ) which width covers all other fields to be
highlighted, which are placed on top of it.
3.) I then have a cmd button on the form's heather to move down with
the following code;
----------------------------
Private Sub Command12_Click()
Dim rs As Recordset
Set rs = Me.Recordset
If IsNull(Me.txtTmp) Or Me.txtTmp = "" Then
Me.txtTmp = 0
End If
If rs.EOF Or rs.BOF Then
MsgBox "problem"
Else
With rs
.FindFirst "[ORDER_ID]=" & Me.txtTmp & ""
If .NoMatch = True Then
.MoveFirst
If .EOF Or .BOF Then
MsgBox "problem"
Else
Me.txtTmp = rs![ORDER_ID]
End If
Else
.MoveNext
If .EOF Or .BOF Then
MsgBox "problem"
Else
Me.txtTmp = rs![ORDER_ID]
End If
End If
Call RowSelect
End With
End If
End Sub
Public Sub RowSelect()
With Me.txtORDER_ID.FormatConditions(0)
.BackColor = RGB(230, 230, 230)
End With
End Sub
--------------------------
I know my code is messy and probably something similar can be achieved
with less lines but any way!!
Any help is appreciated.
Thank
Gavo