• SendKeys with Vista (Access97)

    Author
    Topic
    #452062

    I have a form that contains a combo box to select an item. Upon selecting an item from the list, the AfterUpdate event is used to perform a SendKeys action (enter Key, “~”) in order to move the focus and the cursor to the subform that contains the items’ respective records. Everything has been working fine until I installed a runtime version on a Vista computer. When an item is selected from the list, a box pops up with a “Permission denied” statement. Within this box is an OK button. When the OK button is pressed, everything proceeds normally. It appears that the SendKeys action is a security risk for Vista. Is there another way to code the SendKeys action to be “Vista friendly”?

    Viewing 0 reply threads
    Author
    Replies
    • #1114829

      Try replacing the SendKeys line with

      Me.SubformName.SetFocus

      where SubformName is the name of the subform as a control on the main form.
      This is not necessarily the same as the name of the subform in the database window; open the main form in design view and click once on the subform to see its control name.

      • #1114839

        Thank you very much Hans. That did the trick.

        Ron

    Viewing 0 reply threads
    Reply To: SendKeys with Vista (Access97)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: