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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top