If Statement

D

DS

This If Statement always returns "Already Discounted"
I need it to return "Can't Discount a Discount" if the itemID = 30
etc...

If Me.TxtItemID = 30 Then
DoCmd.OpenForm "frmMsgWarning"
Forms!frmMsgWarning!TxtMsg = "CAN'T DISCOUNT A DISCOUNT"
ElseIf Me.TxtOnce >= 1 Then
DoCmd.OpenForm "frmMsgWarning"
Forms!frmMsgWarning!TxtMsg = "ALREADY DISCOUNTED"
Else
DoCmd.OpenForm "frmFXDiscountSelect"
End If

Thanks
DS
 
D

Douglas J. Steele

Set a break point on the If Me.TxtItemID = 30 Then and see what Access
thinks actually is the value of TxtItemID.
 
D

DS

Douglas said:
Set a break point on the If Me.TxtItemID = 30 Then and see what Access
thinks actually is the value of TxtItemID.
Hi Douglas,
How does one exactly do this?
Thanks
DS
 
D

Douglas J. Steele

Click in the margin to the left of the code.

An alternative would be to put a message box in your code to display the
value.
 
D

DS

Douglas said:
Click in the margin to the left of the code.

An alternative would be to put a message box in your code to display the
value.
Thats a good idea as well.
Thanks
DS
 

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

Similar Threads

Code Is Slow 3
Code Is Slow 6
Loop Problem 5
Correct use of IF ElseIf 5
Code Confusion 11
If Statement is Wacky 2
Checking Field Length 7
Function Not Responding 3

Top