PRA: Help Context ID Property Does Not Work in SubformArticle ID: Q100157
SYMPTOMS
CAUSE
RESOLUTION
'************************************************************* 'Declarations section of the module '************************************************************* Option Explicit Declare Function WinHelp% Lib "User" (ByVal hwnd%, ByVal lpHelpFile$,_ ByVal wCmd%, ByVal dwData As Any) Global Const HELP_CONTEXT = &H1 Global Const HELP_CONTENTS = &H3 '************************************************************* ' FUNCTION NAME: Help() ' ' PURPOSE: ' Based on the currently active control, the Windows Help() API ' function is called to invoke Help on a predefined ContextID for ' the control. If the ControlName is not represented, a ' message appears, indicating no Help topic is available. ' If there is no active form available, the contents of the ' Help file are invoked. ' ' INPUT PARAMETERS: ' HelpFile: Path and filename of Help file to use ' ' RETURN ' None '************************************************************* Function Help (HelpFile As String) Dim ContextID As Long Dim Ret As Integer On Error GoTo HelpError ' Determine which control needs Help and set the ' .. appropriate ContextID for the control. Select Case Screen.ActiveControl.ControlName 'NOTE: You must customize the Case statements that follow ' for your specific control names and the ContextID to call ' for the control name. Case "Category ID" ContextID = 1 Case "Category Name" ContextID = 1 Case "Description" ContextID = 1 Case "Product ID" ContextID = 2 Case "Product Name" ContextID = 2 Case "Unit Price" ContextID = 2 Case "Picture" ContextID = 2 Case Else MsgBox "No help for " & Screen.ActiveControl.ControlName ContextID = -1 End Select ' Call the Help file with the appropriate ContextID. If ContextID > -1 Then Ret = WinHelp(Screen.ActiveForm.hwnd, HelpFile, _ HELP_CONTEXT, ContextID) End If GoTo ByeHelp HelpError: ' Display the Contents window of the Help file. Ret = WinHelp(0, HelpFile, HELP_CONTENTS, 0&) Resume ByeHelp ByeHelp: End Function STATUS Microsoft has confirmed this to be a problem in Microsoft Access version 1.0. This problem no longer occurs in Microsoft Access version 1.1. |
THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.
©1997 Microsoft Corporation. All rights reserved. Legal Notices.
Additional reference words: 1.00
KBCategory: kbusage
KBSubcategory: FmsSubf