Zeusangel 2/10/2012, 01:23
I have this code in my form
Option Compare Database
Dim rs As Object
Dim Modificado As Boolean
Private Const LaTabla As String = "nombre de la tabla"
------------------------------------------
Private Sub Form_Load()
Me.YourField.SetFocus
Set rs = CurrentDb.OpenRecordset(LaTabla)
End Sub
--------------------------------------------
Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull([Organizacion]) Then
MsgBox (" Introduzca la organizacion.")
Cancel = True
Me!Organizacion.Undo
End If
End Sub
------------------------------------------------
Private Sub Form_Dirty(Cancel As Integer)
Modificado = True
End Sub
-----------------------------------------------
try the code you gave me and I get the form does not always go to the field with the focus, the form is closed <
>