AYUDA por favor
Publicado por Fidel (1 intervención) el 26/05/2006 21:30:08
Hola buenas tardes tengan mi problema es el sigueinte:
Tengo un form que se llama recibo; en el cual estan 4 columnas en la primera se llama partida, segunda descripcion, tercera codigo referencia y la cuarta columa se llama Piezas
Bueno quiero llenar ese recibo y en piezas que se venden quiero que se descuenten de la base de datos.... no se si me puedana ayudar... parte del codigo es la que expongo a continuacion
Saludos y espero respuesta o si alguien me dice que estoy mal diganme en donde soy novato en esto y pues me perdi... jijij saludos y espero respuesta
================
Dim cod As String
Private Sub mnuimprime_Click()
Me.PrintForm
End Sub
Private Sub mnusalir_Click()
Unload frmrecibo
End Sub
Private Sub txtficha_KeyPress(KeyAscii As Integer)
Adodc2.RecordSource = "Select * from Trabajador"
Adodc2.Refresh
If KeyAscii = 13 Then
If txtficha.Text = "" Then Exit Sub
cod = Trim(txtficha.Text)
With Adodc2
Do While Not .Recordset.EOF
If (.Recordset.Fields("Ficha").Value = cod) Then
txtnom.Text = .Recordset.Fields("nombre").Value
txtapepat.Text = .Recordset.Fields("Apellido_pat").Value
txtapemat.Text = .Recordset.Fields("Apellido_mat").Value
txtdepto.Text = .Recordset.Fields("departamento").Value
txtextencion.Text = .Recordset.Fields("Extencion_Depto").Value
txttipo.Text = .Recordset.Fields("Tipo_trabajador").Value
txtnomrec.Text = .Recordset.Fields("nombre").Value + " " + .Recordset.Fields("apellido_pat").Value + " " + .Recordset.Fields("apellido_mat").Value
Exit Do
End If
.Recordset.MoveNext
Loop
End With
SendKeys "{tab}"
End If
End Sub
Private Sub Timer1_Timer()
Label1.Caption = Date
Label2.Caption = Time
End Sub
'====================== Esta parte se repite otras 5 veces mas
Private Sub txtclave1_KeyPress(KeyAscii As Integer)
'Dim cod1 As String
Adodc3.RecordSource = "Select * from Inventario"
Adodc3.Refresh
If KeyAscii = 13 Then
If txtclave1.Text = "" Then Exit Sub
cod1 = Trim(txtclave1.Text)
With Adodc3
Do While Not .Recordset.EOF
If (.Recordset.Fields("Partida").Value = cod1) Then
txtnom1.Text = .Recordset.Fields("Descripcion").Value
Text1.Text = .Recordset.Fields("Code").Value
Exit Do
End If
.Recordset.MoveNext
Loop
End With
SendKeys "{tab}"
End If
End Sub
Tengo un form que se llama recibo; en el cual estan 4 columnas en la primera se llama partida, segunda descripcion, tercera codigo referencia y la cuarta columa se llama Piezas
Bueno quiero llenar ese recibo y en piezas que se venden quiero que se descuenten de la base de datos.... no se si me puedana ayudar... parte del codigo es la que expongo a continuacion
Saludos y espero respuesta o si alguien me dice que estoy mal diganme en donde soy novato en esto y pues me perdi... jijij saludos y espero respuesta
================
Dim cod As String
Private Sub mnuimprime_Click()
Me.PrintForm
End Sub
Private Sub mnusalir_Click()
Unload frmrecibo
End Sub
Private Sub txtficha_KeyPress(KeyAscii As Integer)
Adodc2.RecordSource = "Select * from Trabajador"
Adodc2.Refresh
If KeyAscii = 13 Then
If txtficha.Text = "" Then Exit Sub
cod = Trim(txtficha.Text)
With Adodc2
Do While Not .Recordset.EOF
If (.Recordset.Fields("Ficha").Value = cod) Then
txtnom.Text = .Recordset.Fields("nombre").Value
txtapepat.Text = .Recordset.Fields("Apellido_pat").Value
txtapemat.Text = .Recordset.Fields("Apellido_mat").Value
txtdepto.Text = .Recordset.Fields("departamento").Value
txtextencion.Text = .Recordset.Fields("Extencion_Depto").Value
txttipo.Text = .Recordset.Fields("Tipo_trabajador").Value
txtnomrec.Text = .Recordset.Fields("nombre").Value + " " + .Recordset.Fields("apellido_pat").Value + " " + .Recordset.Fields("apellido_mat").Value
Exit Do
End If
.Recordset.MoveNext
Loop
End With
SendKeys "{tab}"
End If
End Sub
Private Sub Timer1_Timer()
Label1.Caption = Date
Label2.Caption = Time
End Sub
'====================== Esta parte se repite otras 5 veces mas
Private Sub txtclave1_KeyPress(KeyAscii As Integer)
'Dim cod1 As String
Adodc3.RecordSource = "Select * from Inventario"
Adodc3.Refresh
If KeyAscii = 13 Then
If txtclave1.Text = "" Then Exit Sub
cod1 = Trim(txtclave1.Text)
With Adodc3
Do While Not .Recordset.EOF
If (.Recordset.Fields("Partida").Value = cod1) Then
txtnom1.Text = .Recordset.Fields("Descripcion").Value
Text1.Text = .Recordset.Fields("Code").Value
Exit Do
End If
.Recordset.MoveNext
Loop
End With
SendKeys "{tab}"
End If
End Sub
Valora esta pregunta
0