Visual Basic Foro
Programación => Visual Basic 6 => Mensaje iniciado por: ale_xi en Enero 07, 2018, 07:14:29 pm
-
hola a todos, Bueno el problema que tengo el dia de hoy es que programe un msgbox donde tengo la opcion
textbox en blanco , pero cuando oprimo en botone realiza accion
lo que quiero es que cuando oprima aceptar no realice nada estas textbox en blanco
Este es el codigo que maneje:
Function Mensajess()
If OpGuias.Value = True Then
If Me.TeNumero.Text = "" Then
MsgBox "Ingrese el número de guia.", vbInformation, "Aviso"
Me.TeNumero.SetFocus
Exit Function
End If
End If
If Me.OpFactura.Value = True Then
If Me.TeNumero.Text = "" Then
MsgBox "Ingrese el número de Factura.", vbInformation, "Aviso"
Me.TeNumero.SetFocus
Exit Function
End If
If Me.TeFecha_V.Text = "" Then
MsgBox "Ingrese la Fecha.", vbInformation, "Aviso"
Me.TeFecha_V.SetFocus
Exit Function
End If
End If
If Me.Opnota.Value = True Then
If Me.TeNumero.Text = "" Then
MsgBox "Ingrese el número de Nota de Credito.", vbInformation, "Aviso"
Me.TeNumero.SetFocus
Exit Function
End If
If Me.TeFecha_V.Text = "" Then
MsgBox "Ingrese la Fecha.", vbInformation, "Aviso"
Me.TeFecha_V.SetFocus
Exit Function
End If
End If
End Function
Private Sub V_Pendiente(Al As Boolean)
If Me.TeNumero.Text = "" Then MsgBox "seleccione una opcion entre guia, factura, N.C., y digite el numero", vbInformation, "Aviso": _
: VMensajeEditar = False: Exit Sub
Call Mensajes
If MsgBox("Esta seguro de grabar Facturas?", vbQuestion + vbYesNo + vbDefaultButton2, "..:: F A C T U R A S ::..") = vbYes Then
Base.BeginTrans
If Al = True Then
Call Modificar_Detalle
If Val(LaPendi) = 0 Then
Call ModificarArticulos_Stock(False)
Else
Call ModificarArticulos_Stock(True)
End If
Call Numeros
Call Regrabar_Historial
Call Regrabar_DetalleHistorial
Call Pago_Resgi_Provedor
Call Pago_Provedor
Call Cabecera_Pedidos
Else
Call Modificar_Detalle
If Val(LaPendi) = 0 Then
Call ModificarArticulos_Stock(False)
Else
Call ModificarArticulos_Stock(True)
End If
Call Numeros
Call Regrabar_Historial
Call Regrabar_DetalleHistorial
Call Pago_Resgi_Provedor
Call Pago_Provedor
End If
Call Modificar_Pendiente
Base.Execute ("Update CABECERA_PEDIDOS Set PENDIENTE=" & Val(VPendiente) & " WHERE ID=" & Val(LaIDPedi) & ""), adCmdText
If VPendiente = Val(2) Then
Base.Execute ("Update DETALLE_PEDIDOS Set FLAG=" & Val(0) & ",AGREGADA=" & Val(7) & " " & _
"WHERE N_PEDIDOS='" & Trim$(TexCodigo_Pe) & "'"), adCmdText
End If
Base.CommitTrans
frmMensajeEditar.Show 1
End If
End Sub
Hay alguna forma de solucionar esto.
gracias
-
Private Function bFailOnVerify() As Boolean
If TxtNombre.Text = "" Then
MsgBox "Nombre esta vacio", vbInformation
TxtNombre.SetFocus
bFailOnVerify = True
Exit Function
End If
bFailOnVerify = False
End Function
Private Sub Guardar()
If bFailOnVerify Then
Exit Sub
End If
db.dbUpdate ...
End Sub
Yo ocupo esta estructura cuando grabo en base de datos, una funcion bFailOnVerify() que devuelve Verdadero si falla algo o Falso si todo está bien. :P