Shading alternatie rows in datasheet view and in form view?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I use this block of code to toggle between formview and datasheet view, in
addition to freezing 3 particualr columns when in datasheet view. I would
like to shade alternate rows. I know ive seen something on it, either here
or elsewhere. Can anyone help me out please. Many thanks in return.

'Toggle Datasheet view
Me.frmCCtrForecast.SetFocus
DoCmd.RunCommand acCmdSubformDatasheet

'Get value or toggle button
Dim intValue As Boolean
intValue = Me.tglSwitchView

'Set Toggle button caption re: state of button
If intValue = False Then
With Me.tglSwitchView
.Caption = "Datasheet View"
End With
ElseIf intValue = True Then
With Me.tglSwitchView
.Caption = "Form View"
End With

'Freeze Account, Description and PT columns
Me!frmCCtrForecast!Account.SetFocus
DoCmd.RunCommand acCmdFreezeColumn

Me!frmCCtrForecast!Description.SetFocus
DoCmd.RunCommand acCmdFreezeColumn

Me!frmCCtrForecast!PT.SetFocus
DoCmd.RunCommand acCmdFreezeColumn

End If
Exit Sub
 
Back
Top