Cantidad e caracteres en campo MEMO
Publicado por Francisco (16 intervenciones) el 19/09/2021 10:35:41
Hola, tengo in textbox asociado a un campo tipo MEMO, y querria saber cuantos caracteres contiene el textbox para que no se pase de una cantidad mayor de 270 caracteres. He intentad en el evento KEYDOWN y BEFOREUPDATE y no funciona
Private Sub COMENTARIO1_BeforeUpdate(Cancel As Integer)
If Len(Me.COMENTARIO1.Text) > 260 Then
MsgBox "MENOS DE 260 CARACTERES"
Exit Sub
End If
end sub
Private Sub COMENTARIO1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
If Len(Me.COMENTARIO1.Text) > 260 Then
MsgBox "NO PUEDE HABER LAS DE 260 CAREACTERES"
Exit Sub
End If
End Sub
En la propiedad comportamiento de la tecla entrar le tengo puesto predeterminado
Alguien me puede ayudar?, gracias.
Private Sub COMENTARIO1_BeforeUpdate(Cancel As Integer)
If Len(Me.COMENTARIO1.Text) > 260 Then
MsgBox "MENOS DE 260 CARACTERES"
Exit Sub
End If
end sub
Private Sub COMENTARIO1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
If Len(Me.COMENTARIO1.Text) > 260 Then
MsgBox "NO PUEDE HABER LAS DE 260 CAREACTERES"
Exit Sub
End If
End Sub
En la propiedad comportamiento de la tecla entrar le tengo puesto predeterminado
Alguien me puede ayudar?, gracias.
Valora esta pregunta


0