Saltar al contenido

Pasar el foco entre dos formularios vba excel

publicado

Buenos dias, amigos espero me puedan ayudar con este problema que encontre. Tengo abierto un formulario1 donde hay un listview, llamo al formulario2 donde ingreso los datos para el listview del formulario1, el problema es que al cerrar el formulario2, quisiera que el foco pase al listview, pero no lo consigo:

Private Sub btnAceptar_Click()

Call Agregar_Asientos_Voucher
Unload Me
UFVouchers.ListView1.SetFocus ''AQUI Mando el foco pero no lo reconoce
End Sub

Sub Agregar_Asientos_Voucher()
Dim i As Integer
With UFVouchers.ListView1
     i = .ListItems.Count + 1
     Rem MsgBox .ListItems.Count
     .ListItems.Add(i).Text = UFSubVouchers.txtCtaCble
     .ListItems.Item(i).ListSubItems.Add.Text = UFSubVouchers.txtDenominacion
     
     If UFSubVouchers.txtDebe <> "" Then
        .ListItems.Item(i).ListSubItems.Add.Text = UFSubVouchers.txtDebe
     Else
        .ListItems.Item(i).ListSubItems.Add.Text = " "
     End If
     
     If UFSubVouchers.txtHaber <> "" Then
        .ListItems.Item(i).ListSubItems.Add.Text = UFSubVouchers.txtHaber
     Else
        .ListItems.Item(i).ListSubItems.Add.Text = " "
     End If
End With
End Sub
 

Featured Replies

publicado

@mangelperu , siempre es mejor (por no decir necesario...) subir tu archivo de ejemplo para poder trabajar sobre él

Archivado

Este tema está ahora archivado y está cerrado a más respuestas.