evento keypress
Publicado por Angel (3 intervenciones) el 06/04/2019 19:42:35
hola buen dia, estoy realizando un proyecto y requiero que cuando ingrese en mi textbox llamada numsap me aparezca el nombre por default extraido de mi base de datos, paro no me lo ejecuta, apoyo por favor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Private Sub NUMSAP_KEYPRESS(sender As Object, e As System.Windows.Forms.KeyPressEventArgs) Handles NUMSAP.KeyPress
If Split(NUMSAP.Text, vbNewLine).Length > 1 Then
NUMSAP.Text = NUMSAP.Text.Replace(vbNewLine, "")
conex.Open()
Dim cadena As String = "select * from BDATA.RH.TC_Personal where CStr(No_SAP)= " & NUMSAP.Text & ""
If Not cadena Then
NUMSAP.Text = Me.NUMSAP.Text
NOMBRE.Text = Me.NOMBRE.Text
conex.Close()
Else
NUMSAP.Text = NUMSAP.Text
End If
NOMBRE.Text = Nothing
End If
End Sub
Valora esta pregunta


0