Ver Mensaje Individual
  #4 (permalink)  
Antiguo 13/04/2011, 16:48
Avatar de pkj
pkj
 
Fecha de Ingreso: julio-2006
Ubicación: Órbita sincrónica
Mensajes: 899
Antigüedad: 17 años, 8 meses
Puntos: 29
Respuesta: MsgBox al encontrar "comas"

Necesitas organizar tu código. Solo te falta añadir otro "End If" al final o hacer algo asi:

Código vb:
Ver original
  1. Private Sub botAgregar_Click()
  2.  
  3.   If InStr(1, txtNue.Text, ",")<>0 then
  4.     MsgBox "No se admiten comas (,) en el texto." & vbcrlf & "Corríjalo antes de seguir.", vbOKOnly, "Error"
  5.     txtNue.SetFocus
  6.     Exit Sub
  7.   End If
  8.  
  9.   If Trim(txtNue.Text) = "" Then
  10.     st = MsgBox("Escriba la palabra o frase a agregar", vbOKOnly, "Error")
  11.     txtNue.SetFocus
  12.   Else
  13.     If buscaPor = "evento" And IsDate(txtFecEve.Text) = False Then
  14.       st = MsgBox("No es una fecha correcta", vbOKOnly, "Error")
  15.     Else
  16.       Screen.MousePointer = 11
  17.       Y = InsertaCatalogo(buscaPor, txtNue.Text, modoCatalogo, txtFecEve.Text)
  18.       If Y = True Then
  19.         pivote = txtNue.Text
  20.         origen = "mantenimiento"
  21.         Screen.MousePointer = 0
  22.         MsgBox "Registro agregado satisfactoriamente"
  23.         Unload Me
  24.       End If
  25.  
  26.     End If
  27.  
  28.   End If
  29.  
  30. End Sub

Saludos
__________________
No hay preguntas tontas, solo gente estup..., ¡No!, ¿como era? No hay gente que pregunte a tontos... ¡Nooo!... ¡Vaya cabeza!