Code Examples For RunCommand Constants

Create and add to a New Group

acCmdNewGroup, acCmdAddToNewGroup

I found this examle in the microsoft.public.access.modulesdaovba newsgroup posted by somebody called Alex. It addes a new group to the database window.

'***************** Code Start *******************
Sub AddNewGroup(strGroupName)

  SendKeys strGroupName & "~"
  Application.RunCommand acCmdNewGroup
End Sub


Sub AddToNewGroup(strGroupName, strViewName)
  DoCmd.SelectObject acServerView, strViewName, True
  SendKeys strGroupName & "~"
  Application.RunCommand acCmdAddToNewGroup
End Sub
'****************** Code End ********************