G
Guest
I've got a simple code that compares with a value and if exceeded, to pop a
warning and then setfocus on the same field to allow the user to amend the
figure. However, the setfocus doesn't seem to work:
If Val(txtWeightageTemp) + Val(txtTotalWeight) - bytWeightage > 100 Then
MsgBox "Your total weightage for this subject has been exceeded.
Please re-enter.", vbOKOnly
Me.txtWeightageTemp = ""
Me.txtWeightageTemp.SetFocus
End If
I've tried something similar before and it always works. Am I missing
something somewhere? Thanks.
ck
warning and then setfocus on the same field to allow the user to amend the
figure. However, the setfocus doesn't seem to work:
If Val(txtWeightageTemp) + Val(txtTotalWeight) - bytWeightage > 100 Then
MsgBox "Your total weightage for this subject has been exceeded.
Please re-enter.", vbOKOnly
Me.txtWeightageTemp = ""
Me.txtWeightageTemp.SetFocus
End If
I've tried something similar before and it always works. Am I missing
something somewhere? Thanks.
ck