Problema con el Focus
Publicado por Raziel (61 intervenciones) el 03/10/2009 19:25:45
Tengo estas lineas de codigo:
Private Sub txtEMPRESA_AfterUpdate()
'CUENTA LAS VECES QUE APARECE EL TEXTO TECLEADO EN LA TABLA A GUARDAR,
'SI ES MAYOR A CERO ENVIA MENSAJE Y NO PERMITE GUARDAR
Dim intCUENTAEMPRESA As Integer
intCUENTAEMPRESA = DCount("[strEMPRESA]", "tblEMPRESAS", "[strEMPRESA] ='" & Me!txtEMPRESA.Value & "'")
If intCUENTAEMPRESA > 0 Then
MsgBox "EL NOMBRE QUE HA TECLEADO YA EXISTE, POR FAVOR INTRODUCE UN TEXTO DISTINTO.", , "TEXTO DUPLICADO."
txtEMPRESA.Value = Null
Me.txtEMPRESA.SetFocus
End If
End Sub
Por que el focus no regresa al control cuando la condicion se cumple?????
Private Sub txtEMPRESA_AfterUpdate()
'CUENTA LAS VECES QUE APARECE EL TEXTO TECLEADO EN LA TABLA A GUARDAR,
'SI ES MAYOR A CERO ENVIA MENSAJE Y NO PERMITE GUARDAR
Dim intCUENTAEMPRESA As Integer
intCUENTAEMPRESA = DCount("[strEMPRESA]", "tblEMPRESAS", "[strEMPRESA] ='" & Me!txtEMPRESA.Value & "'")
If intCUENTAEMPRESA > 0 Then
MsgBox "EL NOMBRE QUE HA TECLEADO YA EXISTE, POR FAVOR INTRODUCE UN TEXTO DISTINTO.", , "TEXTO DUPLICADO."
txtEMPRESA.Value = Null
Me.txtEMPRESA.SetFocus
End If
End Sub
Por que el focus no regresa al control cuando la condicion se cumple?????
Valora esta pregunta


0