Jump to content
Fórum Script Brasil
  • 0

Dúvida: Executar evento KeyDown a partir de outro UserForm


Armando Amador Pereira
 Share

Question

Problema é o seguinte

==== UserFormX ===================================================================
Private Sub txtOrdemVenda_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)

    If KeyCode = vbKeyReturn Then

                        'Todo procedimento aqui

      End if

End Sub

======== UserFormY ===================================================================
Private Sub c_lstPedidos_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
           'Todo procedimento aqui...

          'Pergunta: como chamar o evento KeyDown do UserFormX  ???

End sub

Agradeço demais quem puder ajudar.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Ola... tenho pouco conhecimento mas acredito q te resolveria o problema usando um modulo no evento do keydown

cria o modulo "sub keyReturn" e coloca a função que você quer que ele execute

==== UserFormX ===================================================================

Private Sub txtOrdemVenda_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)

    If KeyCode = vbKeyReturn Then

                        keyReturn 'chama sua sub na txtOrdemVenda

      End if

End Sub

 

======== UserFormY ===================================================================
Private Sub c_lstPedidos_DblClick(ByVal Cancel As MSForms.ReturnBoolean)          

                keyReturn 'chama a mesma sub no evento de click duplo na c_listPedidos

End sub

 

 

Bom espero q ajude. Sou bem iniciante no VBA mas acho que resolveria pra você dessa forma.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Forum Statistics

    • Total Topics
      149.9k
    • Total Posts
      646.8k
×
×
  • Create New...