urgente
Publicado por rox (1 intervención) el 10/05/2007 15:14:51
tengo el siguiente codigo para restar de una tabl yamada prestamo a la tabla
material y por algun motivo no resta me pasa directamente a el mensaje que no puedo realizar el prestamoalguien me puede ayudar trabajo como vb 6.0
MsgBox Str(Resultado.Fields(0)) + " " + Str(Resultado.Fields(1)) + Resultado.Fields(2)
If Str(Resultado.Fields(0)) = Resultado.Fields(0) And Text2.Text > 0 And Text2.Text <= Resultado.Fields(1) Then
Conexion.Execute ("update asignatura set cantidad = " & val(Mid(Combo1.Text, 1, 2)) - val(Text2.Text) & " where cod_libro = '" & val(Mid(Combo1.Text, 1, 2)) & "' ")
Conexion.Execute ("Insert into prestamo(rut,cantidad, lugar_prestamo,fecha_devolucion,observacion, cod_libro ) values ('" & Text1.Text & "', '" & val(Text2) & "', '" & Combo2.Text & "', '" & DTPicker1.Value & "', '" & Text4.Text & "', '" & val(Mid(Combo1.Text, 1, 2)) & "') ")
Else
MsgBox "no se puede realizar el prestamo razon no hay disponibilidad"
material y por algun motivo no resta me pasa directamente a el mensaje que no puedo realizar el prestamoalguien me puede ayudar trabajo como vb 6.0
MsgBox Str(Resultado.Fields(0)) + " " + Str(Resultado.Fields(1)) + Resultado.Fields(2)
If Str(Resultado.Fields(0)) = Resultado.Fields(0) And Text2.Text > 0 And Text2.Text <= Resultado.Fields(1) Then
Conexion.Execute ("update asignatura set cantidad = " & val(Mid(Combo1.Text, 1, 2)) - val(Text2.Text) & " where cod_libro = '" & val(Mid(Combo1.Text, 1, 2)) & "' ")
Conexion.Execute ("Insert into prestamo(rut,cantidad, lugar_prestamo,fecha_devolucion,observacion, cod_libro ) values ('" & Text1.Text & "', '" & val(Text2) & "', '" & Combo2.Text & "', '" & DTPicker1.Value & "', '" & Text4.Text & "', '" & val(Mid(Combo1.Text, 1, 2)) & "') ")
Else
MsgBox "no se puede realizar el prestamo razon no hay disponibilidad"
Valora esta pregunta


0