If Or And statement possible...? (1 Viewer)

ian_ok

Registered User.
Local time
Today, 19:08
Joined
May 1, 2001
Messages
90
I'm trying to use the following but not sure if I am asking too much.

Code:
If Me.Ctl2nd_Payment_Payable = "Paid" Or Me.Ctl2nd_Payment_Payable = "Pagado" And IsNull(Me.Ctl2nd_Payment_Date_Paid) Then
MsgBox ("Error - Check the 2nd Payment details as it says PAID / PAGADO yet the date paid has not been added")
        Response = acDataErrContinue

If I take out the
Code:
Or Me.Ctl2nd_Payment_Payable = "Pagado"
Then it works, can I not do it so I only need one line of code rather than a new If for Paid and the Pagado?

Thanks

Ian
 

SimonB1978

Registered User.
Local time
Today, 14:08
Joined
Jan 22, 2009
Messages
161
Probably need some parentheses (bold red):

If (Me.Ctl2nd_Payment_Payable = "Paid" Or Me.Ctl2nd_Payment_Payable = "Pagado") And IsNull(Me.Ctl2nd_Payment_Date_Paid) Then
MsgBox ("Error - Check the 2nd Payment details as it says PAID / PAGADO yet the date paid has not been added")
Response = acDataErrContinue


HTH,

Simon B.
 

ian_ok

Registered User.
Local time
Today, 19:08
Joined
May 1, 2001
Messages
90
Thanks Simon always a simple way out, why didnb't I think of that....Doh...!!

Cheers Ian
 

DCrake

Remembered
Local time
Today, 19:08
Joined
Jun 8, 2005
Messages
8,632
To simplify it eaven further

if Left(Me.Ctl2nd_Payment_Payable,2) = "Pa" ....
 

Users who are viewing this thread

Top Bottom