Autor Tema: Como programar Msgbox textbox en blanco  (Leído 926 veces)

0 Usuarios y 1 Visitante están viendo este tema.

ale_xi

  • Bytes
  • *
  • Mensajes: 30
  • Reputación: +3/-1
    • Ver Perfil
Como programar Msgbox textbox en blanco
« 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:


Código: [Seleccionar]
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

Código: [Seleccionar]
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
« última modificación: Enero 08, 2018, 03:25:01 am por ale_xi »

Virgil Tracy

  • Kilobyte
  • **
  • Mensajes: 64
  • Reputación: +38/-1
    • Ver Perfil
Re:Como programar Msgbox textbox en blanco
« Respuesta #1 en: Enero 09, 2018, 05:13:12 am »
Código: (vb) [Seleccionar]
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