dcsimg
Results 1 to 10 of 10

Thread: [RESOLVED] errror 70 on press key return

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Mar 2005
    Location
    Italy-Napoli
    Posts
    1,981

    Resolved [RESOLVED] errror 70 on press key return

    Code:
    Private Sub txtfind_KeyDown(KeyCode As Integer, Shift As Integer)
    
        If KeyCode = vbKeyReturn Then
            SendKeys "{TAB}" <<<< error here
            End If
        If KeyCode = vbKeyUp Then
            SendKeys "+{TAB}"
        End If
        If KeyCode = vbKeyF6 Then
            Call cmdtrova_Click
        End If
        
    End Sub
    when press enter key have:
    SendKeys is: "Error 70 - access denied

    ????

    i'm on VB 6.0

  2. #2
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    7,406

    Re: errror 70 on press key return

    Try this:
    Code:
        If KeyCode = vbKeyReturn Then
            Dim WshShell As Object
            Set WshShell = CreateObject("WScript.Shell")
            WshShell.SendKeys "{Tab}"
        End If

  3. #3
    Hyperactive Member
    Join Date
    Mar 2017
    Posts
    352

    Re: errror 70 on press key return

    Must be you luca, I have no problem with your code. You must be tabbing to something you do not have access to

  4. #4
    PowerPoster
    Join Date
    Dec 2004
    Posts
    24,852

    Re: errror 70 on press key return

    did you test when compiled?
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  5. #5
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    7,406

    Re: errror 70 on press key return

    @westconn1...it should NOT error out when compiled. (Tested). In IDE, unless I use WScript.Shell, it will give me the same error...but my post #2 above works in IDE, AND compiled.

    But I think luca90 has gone AWOL. :-)

  6. #6
    Fanatic Member
    Join Date
    Feb 2019
    Posts
    706

    Re: errror 70 on press key return

    This is a known problem in Vista+, and there are many solutions if the OP entered the subject of this thread in any search engine.

  7. #7
    Frenzied Member jdc2000's Avatar
    Join Date
    Oct 2001
    Location
    Idaho Falls, Idaho USA
    Posts
    1,609

  8. #8
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    7,406

    Re: errror 70 on press key return

    HEY!!! I offered solution for FREE! You must be taking advantage of COVID19! ~smile~

  9. #9
    Hyperactive Member
    Join Date
    Mar 2017
    Posts
    352

    Re: errror 70 on press key return

    Looks like your FREE solution was already FREE back in 2013
    Last edited by Ordinary Guy; Mar 26th, 2020 at 01:56 PM.

  10. #10
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    7,406

    Re: errror 70 on press key return

    It was....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width