Results 1 to 4 of 4
  1. #1
    jennifers is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Sep 2019
    Posts
    19

    Access VBA SendKeys disabling Numlock


    This code is disabling my Numlock. Is there something I can add to enable it again?
    Code:
    Public Sub Go_To_WAP_Module(WAP_Module As String, Optional ObjectType As String, Optional ObjectName As String)
    On Error GoTo Err_Handler
    
    
        Dim appAccess As New Access.Application
        Dim strFormName As String, frm As Form, ctl As ComboBox
        
        Set appAccess = Nothing
        Set appAccess = OpenAccessApp(WAP_Module, True)
        'appAccess.DoCmd.Maximize
        SendKeys "% x", True
        
        Select Case ObjectType
            Case "Form"
                appAccess.DoCmd.OpenForm ObjectName
            Case "Report"
                strFormName = "Report Options"
    '            appAccess.DoCmd.OpenForm ObjectName
                Set frm = appAccess.Forms(strFormName)
                Set ctl = frm!cboReport
                ctl = ObjectName
                frm.cboReport_AfterUpdate
                
    '            appAccess.DoCmd.OpenReport ObjectName, acViewPreview
        End Select
        
    Exit_Handler:
        Exit Sub
    
    
    Err_Handler:
        MsgBox Err.Description
        Resume Exit_Handler
        Resume Next
    End Sub

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    That's a known bug:

    http://theaccessweb.com/api/api0046.htm

    I've read you can add this to the end:

    Sendkeys "{NUMLOCK}", True

    Most of us don't use SendKeys, so there may be a different way of doing what you're doing.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    jennifers is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Sep 2019
    Posts
    19
    Thank you! That works for my purpose. I am working with making an old database work during efforts to create a fully upgraded version.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Disabling Access Form Selection
    By Eranka in forum Access
    Replies: 1
    Last Post: 01-23-2018, 06:31 AM
  2. NumLock/CapsLock/ScrollLock turns off
    By SLSHELL in forum Access
    Replies: 4
    Last Post: 12-07-2017, 10:04 AM
  3. SendKeys works on rare occasions in Access 2010
    By JamesAnderson1984 in forum Access
    Replies: 12
    Last Post: 08-09-2013, 11:47 PM
  4. Replies: 4
    Last Post: 05-18-2012, 06:07 PM
  5. Set NumLock
    By June7 in forum Programming
    Replies: 7
    Last Post: 07-05-2011, 06:05 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums