Hi, I think to do what you want you need to modify the switchboard a little. Go to Design View, then code View.
Find the following (there are a few lines added) and add the last line
Const conCmdDataSheet = 14
to your code. You can change the number 14 to the next in the list , probably 9.
Private Function HandleButtonClick(intBtn As Integer)
Dim StSql As String
' This function is called when a button is clicked.
' intBtn indicates which button was clicked.
' Constants for the commands that can be executed.
Const conCmdGotoSwitchboard = 1
Const conCmdOpenFormAdd = 2
Const conCmdOpenFormBrowse = 3
Const conCmdOpenReport = 4
Const conCmdCustomizeSwitchboard = 5
Const conCmdExitApplication = 6
Const conCmdRunMacro = 7
Const conCmdRunCode = 8
Const conCmdOpenPage = 9
Const conCmdOpenTable = 10
Const conCmdOpenQuery = 11
Const conCmdOpenQueryDesign = 12
Const conCmdSnapshot = 13
Const conCmdDataSheet = 14
Once You've added this, scroll on down till you find the following:
Select Case rs![Command]
' Go to another switchboard. = 1
Case conCmdGotoSwitchboard
Me.Filter = "[ItemNumber] = 0 AND [SwitchboardID]=" & rs![Argument]
' Open a form in Add mode. = 2
Case conCmdOpenFormAdd
DoCmd.OpenForm rs![Argument], , , , acAdd
' Open a form. = 3
Case conCmdOpenFormBrowse
DoCmd.OpenForm rs![Argument]
' Open a report. = 4
Case conCmdOpenReport
DoCmd.OpenReport rs![Argument], acPreview
' Customize the Switchboard. = 5
Case conCmdCustomizeSwitchboard
' Handle the case where the Switchboard Manager
' is not installed (e.g. Minimal Install).
On Error Resume Next
Application.Run "ACWZMAIN.sbm_Entry"
If (Err <> 0) Then MsgBox "Command not available."
On Error GoTo 0
' Update the form.
Me.Filter = "[ItemNumber] = 0 AND [Argument] = 'Default' "
Me.Caption = Nz(Me![ItemText], "")
FillOptions
' Exit the application. = 6
Case conCmdExitApplication
CloseCurrentDatabase
' Run a macro. = 7
Case conCmdRunMacro
DoCmd.RunMacro rs![Argument]
' Run code. = 8
Case conCmdRunCode
Application.Run rs![Argument]
' Open a Data Access Page =9
Case conCmdOpenPage
DoCmd.OpenDataAccessPage rs![Argument]
' Open a Table =10
Case conCmdOpenTable
DoCmd.OpenTable rs![Argument], acViewNormal, acReadOnly
' Open Querry = 11
Case conCmdOpenQuery
DoCmd.OpenQuery rs![Argument]
' Open Querry = 12
Case conCmdOpenQueryDesign
DoCmd.OpenQuery rs![Argument], acViewDesign
' Open Snapshot 13
Case conCmdSnapshot
DoCmd.OutputTo acOutputReport, rs![Argument], acFormatSNP
'Use Datasheet 14
Case conCmdDataSheet
DoCmd.OpenForm rs![Argument], acFormDS
' Any other command is unrecognized.
Case Else
MsgBox "Unknown option."
End Select
I left the extra rows in to show other command that can be added. The only rows that matter are in green.
Do a debug - compile to check for errors.
Final Step:
You can go directly to the Switchboard table and find the column whose header is 'Command'. Scroll down to the form you wish to open in datasheet view and change the number there which is probably a 3 to the number 14 if you used the above example.
So, to recap by doing this you've created a new argument in the switchboard. You use this argument in the switchboard table to open the form in datasheet mode.
Hope that helps.