none
VBA issue on WIN7 RRS feed

  • Question

  • I have application called workdesk which has VBA editor tool in it for any modifications. We are migrating the application from XP to Win 7. We are facing a problem in the code after we moved the application to WIN7.

    The problem is about focus on control.

    We have a validation for each and every controls, if the validation fails, we throw error message and keep the focus on the same control to correct the error. If the validation passed then focus must be moved to next control.

    The issue we are facing is whenever the validation is failed the message box pops up when we click ok, the focus is moving to the control but we can;t able to type-in in the control. we have to use to mouse to select the control then we have to type-in. I'm sure the focus is in that control but its not allowing us to type any character through keyboard unless we use mouse to select the control....

    This piece of code worked fine in XP...but having issue over WIN7.

    I use Cancel = true to keep the focus on the same control, I used this validation on File_Exit event.

    hope you understand my problem....

    Let me know if you need further details...

    pls help.

    Thanks in advance,
    Gowrisankar
    Monday, August 25, 2014 3:20 AM

All replies

  • If you using form in VBA, you can select control using controlName.setfocus in your code.

    That'll works only when that control 'll .enabled = true

    Also, you can step by step from one control to another using tab kay.

    To set good way, you should focus on .TabIndex parameter each control.

    2nd also, you can use shortkays set on Labels, but number of index, should be 1 less, then control you want to select and letter to shortcut you should add to .accelerator parameter. That letter should include in word you're using in caption.


    Oskar Shon, Office System MVP - www.VBATools.pl
    if Helpful; Answer when a problem solved

    Friday, August 29, 2014 7:08 AM
    Answerer
  • And... Did you want to know more, or you check solution I wrote

    Oskar Shon, Office System MVP - www.VBATools.pl
    if Helpful; Answer when a problem solved

    Tuesday, September 23, 2014 9:22 AM
    Answerer