L
ldiaz
Hello all.
I have this code, but when I enter a value and press enter, the set focus
goes directly to first line of the records of the subform,
I think the problem is the setfocus event, but how can I solve this?
Thanks in advanced.
=============================
Private Sub DT_Min_AfterUpdate()
Me.Recalc
If ([Forms]![frm_Production_Report]![TSum]) > 60 Then
MsgBox "You can't report a value greater that 60 Minutes!", vbCritical,
"Error, exceed value"
'Delete value
Me.DT_Min = "1"
'pass code
Me.DT_Code.SetFocus
'focus
Me.DT_Min.SetFocus
ElseIf IsNull(Me.DT_Min) Or Me.DT_Min < 1 Then
MsgBox "Zero or Null value, select a value beetween 1 and 60", vbCritical,
"Zero or Null value error"
'Delete value
Me.DT_Min = "1"
'pass code
Me.DT_Code.SetFocus
'focus
Me.DT_Min.SetFocus
Else
Me.Comments.SetFocus
End If
End Sub
=============================
I have this code, but when I enter a value and press enter, the set focus
goes directly to first line of the records of the subform,
I think the problem is the setfocus event, but how can I solve this?
Thanks in advanced.
=============================
Private Sub DT_Min_AfterUpdate()
Me.Recalc
If ([Forms]![frm_Production_Report]![TSum]) > 60 Then
MsgBox "You can't report a value greater that 60 Minutes!", vbCritical,
"Error, exceed value"
'Delete value
Me.DT_Min = "1"
'pass code
Me.DT_Code.SetFocus
'focus
Me.DT_Min.SetFocus
ElseIf IsNull(Me.DT_Min) Or Me.DT_Min < 1 Then
MsgBox "Zero or Null value, select a value beetween 1 and 60", vbCritical,
"Zero or Null value error"
'Delete value
Me.DT_Min = "1"
'pass code
Me.DT_Code.SetFocus
'focus
Me.DT_Min.SetFocus
Else
Me.Comments.SetFocus
End If
End Sub
=============================