Control Field Entry based on another filed

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Help me please!

My form has both a Discount Dollar and Discount Percentage I want to be able
to write a code that will not allow someone to enter both a dollar and
percentage discount. So that if the dollar discount is greater than 0. the
percentage discount must be 0. Can anyone give me some suggestions as to how
to write this code and where to put it?

thanks
 
Make an AfterUpdate event for both fields (DollarDiscount and
PercentDiscount).

Code each event as follows:

Private Sub DollarDiscount_AfterUpdate()
If Me.DollarDiscount > 0 Then
Me.PercentDiscount = 0
End If
End Sub

Private Sub PercentDiscount_AfterUpdate()
If Me.PercentDiscount > 0 Then
Me.DollarDiscount = 0
End If
End Sub

Good Luck
Kjartan
 
Back
Top