M
Matt
I'm trying to toggle between datasheet/form view on a
subform by double-clicking on a field in Access 2002.
This function under Access 2000 worked:
Public Function basToggleSubform()
Const MENU_VIEW = 2
Const CMD_SUBFORM_DATASHEET = 3
DoCmd.DoMenuItem acFormBar, MENU_VIEW,
CMD_SUBFORM_DATASHEET
End Function
It does not work under 2002. I've also tried switching
to the Docmd.RunCommand format:
Public Function basToggleSubform(frm As Form)
Const conformview = 1
Const condataview = 2
Dim intview As Integer
intview = frm.CurrentView
Select Case intview
Case conformview
DoCmd.RunCommand acCmdDatasheetView
Case condataview
DoCmd.RunCommand acCmdFormView
End Select
End Function
This gives me an error stating:
The expression you entered has a function containing the
wrong number of arguments.
I tried to add a shortcut menu to the form to be able to
switch between the two views, but the menu changes the
main form, not the subform. Even though the shortcut
menu is assigned the the subform itself.
I'm at a loss... any help would be aprreciated.
subform by double-clicking on a field in Access 2002.
This function under Access 2000 worked:
Public Function basToggleSubform()
Const MENU_VIEW = 2
Const CMD_SUBFORM_DATASHEET = 3
DoCmd.DoMenuItem acFormBar, MENU_VIEW,
CMD_SUBFORM_DATASHEET
End Function
It does not work under 2002. I've also tried switching
to the Docmd.RunCommand format:
Public Function basToggleSubform(frm As Form)
Const conformview = 1
Const condataview = 2
Dim intview As Integer
intview = frm.CurrentView
Select Case intview
Case conformview
DoCmd.RunCommand acCmdDatasheetView
Case condataview
DoCmd.RunCommand acCmdFormView
End Select
End Function
This gives me an error stating:
The expression you entered has a function containing the
wrong number of arguments.
I tried to add a shortcut menu to the form to be able to
switch between the two views, but the menu changes the
main form, not the subform. Even though the shortcut
menu is assigned the the subform itself.
I'm at a loss... any help would be aprreciated.