HelpFile Property [Access 2003 VBA Language Reference]
The name of a help file associated with a form or report. Read/write String.
expression Required. An expression that returns one of the objects in the Applies To list.
In Microsoft Access, you can use the ToolbarControl Properties dialog box for command bar controls to set the HelpFile property for a control on a command bar. Display the Customize dialog box by pointing to Toolbars on the View menu and clicking Customize. For menu bar and toolbar controls, display the menu bar or toolbar, and then right-click the control whose HelpFile property you want to set. For shortcut menu controls, select the Shortcut Menus check box on the Toolbars tab of the Customize dialog box, then find the shortcut menu control you want on the menu bar that's displayed and right-click the control. Click the Properties command. Enter the name of the Help file you want in the Help File box.
This example adds a custom command bar with a combo box that tracks stock data. The example also specifies the Help topic to be displayed for the combo box when the user presses SHIFT+F1.
Set myBar = CommandBars _ .Add(Name:="Custom", Position:=msoBarTop, _ Temporary:=True) With myBar .Controls.Add Type:=msoControlComboBox, ID:=1 .Visible = True End With With CommandBars("Custom").Controls(1) .AddItem "Get Stock Quote", 1 .AddItem "View Chart", 2 .AddItem "View Fundamentals", 3 .AddItem "View News", 4 .Caption = "Stock Data" .DescriptionText = "View Data For Stock" .HelpFile = "C:\corphelp\custom.hlp" .HelpContextID = 47 End With
See Also | HelpContextId Property