spirit wrote:
I need a procedure for a DeliveryCharge field value of $0, the
MaxDistance field value must equal 0. if the DelivelryChare field
value is invalid, then i'm to display the appropriate message, cancel
the event, undo the change, and move the focus to the DeliveryCharge
field and no specila steps are taken for other DeliveryCharge field
values....
The best place to do validation is in the BeforeUpdate event of the control.
One of the advantages is that this event has a Cancel argument. When you set
Cancel = to True the update is actually cancelled and focus never leaves the
control so there is no need for code to set the focus back. In your case...
DeliveryCharge_BeforeUpdate (Cancel As Integer)
If Me!DeliveryCharge = 0 _
And Me!MaxDistance = 0 Then
MsgBox "Invalid Entry"
Cancel = True
Me!DeliveryCharge.Undo
End If
End Sub
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com