locked
how do i pass the function of F1 to a form, i am using to replace msgbox function? the Err.HelpContext RRS feed

  • Question

  • I seemed to be forced to create a replacement for the msgbox function for an app.

    At lest as far as Displaying All Err.values   like #, Description, and where error occurred.

    only problem left is how to have my form have the function of "F1" to access the help user could get if Error msg was displayed in a msgbox function.

    I have been able to pass all values of Err to another form.  From Err.# to   Err.HelpFile   and Err.HelpContext

    I am unable to figure out how in my ErrMsgForm 

    to take ANS USE the Err.# and Err.HelpFile and Err.HelpContext values .

    Maybe, One button on my ErrMsgForm  has a caption of "HELP", Then on click_event of "HELP" button, run procedure with a divide by zero.  Then in what would be usual error handling code and msg. So after the Err.HelpContext receives a value in the divide by zero procedure, Then set Err.HelpContext = the value of Err.HelpContext passed from were the ErrMsgForm was called from. 


    Mark J

    Wednesday, February 1, 2017 2:17 PM

Answers

  • Hi Mark,

    >> One button on my ErrMsgForm  has a caption of "HELP", Then on click_event of "HELP" button, run procedure with a divide by zero

    Do you mean you want this button to achieve the same function of F1 to access help page? If so, I suggest you try SendKeys function in button event.

    Here is a simple code:

    Private Sub Command20_Click()
    SendKeys "{F1}"
    End Sub

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by PuzzledByWord Friday, February 3, 2017 11:23 AM
    Thursday, February 2, 2017 5:32 AM

All replies

  • Hi Mark,

    I'm not sure I understand your question. Have you tried using an Autokeys macro?

    Just a thought...

    Wednesday, February 1, 2017 4:26 PM
  • Hi Mark,

    >> One button on my ErrMsgForm  has a caption of "HELP", Then on click_event of "HELP" button, run procedure with a divide by zero

    Do you mean you want this button to achieve the same function of F1 to access help page? If so, I suggest you try SendKeys function in button event.

    Here is a simple code:

    Private Sub Command20_Click()
    SendKeys "{F1}"
    End Sub

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by PuzzledByWord Friday, February 3, 2017 11:23 AM
    Thursday, February 2, 2017 5:32 AM
  • Edward,thanks

    works, now to try the control break bit...    from ref page looks like I do it like this

    SendKeys "^{BREAK}"

    Thanks

    Mark J


    Mark J

    Friday, February 3, 2017 11:23 AM