------------代码 冻结 列及取消冻结列-----------------------
Private Sub cmdFreeze_Click()
On Error GoTo ErrCmdFreeze
Me.subTestForm.SetFocus
If Me.cmdFreeze.Caption = "Freeze Column" Then
DoCmd.RunCommand acCmdFreezeColumn
Me.cmdFreeze.Caption = "Unfreeze Column"
Else
DoCmd.RunCommand acCmdUnfreezeAllColumns
Me.cmdFreeze.Caption = "Freeze Column"
End If
Exit Sub
ErrCmdFreeze:
Select Case Err
Case 2046
'Command not available
MsgBox "This command is not available at this time"
Exit Sub
Case Else
MsgBox Err.Number & vbCrLf & Err.Description
Exit Sub
End Select