Private Sub cmdDatasheet_Click()
'***************** Code Start *******************
'This code was originally written by Terry Wickenden.
' It is not to be altered or distributed,
' except as part of an application.
' You are free to use it in any application,
' provided the copyright notice is left unchanged.
On Error GoTo ErrCmdDatasheet
Me.Log.SetFocus
DoCmd.RunCommand acCmdSubformDatasheet
If Me.cmdDatasheet.Caption = "Datasheet View" Then
Me.cmdDatasheet.Caption = "Form View"
Else
Me.cmdDatasheet.Caption = "Datasheet View"
End If
Exit Sub
ErrCmdDatasheet:
Select Case Err
Case 2046
'Datasheet view not available
MsgBox "This command not available at this time"
Exit Sub
Case Else
MsgBox Err.Number & vbCrLf & Err.Description
Exit Sub
End Select
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.