Condition in Expression

P

Peter

Hi all!...i have this issue. In a forms “after update†event I use the
following expression:

1. I receive error message “optional argumentâ€

If (Me.Bag = "Apples") And IIf (Me.Days = IsNull > 30) Then
Me.Days.SetFocus
MsgBox "Bla..bla bla "
End If

Thank you!
 
M

Marshall Barton

Peter said:
Hi all!...i have this issue. In a forms “after update” event I use the
following expression:

1. I receive error message “optional argument”

If (Me.Bag = "Apples") And IIf (Me.Days = IsNull > 30) Then
Me.Days.SetFocus
MsgBox "Bla..bla bla "
End If


IIf (Me.Days = IsNull > 30) is both incomplete and has an
invalid expression. If you'll explain **what** you are
trying to do, maybe we can figure out how to do it.
 
P

Peter

Hi Marshall,

I want to display a message If the control Apple contains "Apple" and if the
control Days has the value that exceeds 30...

Tahnks
 
M

Marshall Barton

I thought you wanted to check something about the control
Bags and something being Null, but for a control named Apple
containing "Apple", it would be:

If Me.Apple = "Apples" And Me.Days > 30 Then
 
P

Peter

Thanks Marshall!

Marshall Barton said:
I thought you wanted to check something about the control
Bags and something being Null, but for a control named Apple
containing "Apple", it would be:

If Me.Apple = "Apples" And Me.Days > 30 Then
--
Marsh
MVP [MS Access]

I want to display a message If the control Apple contains "Apple" and if the
control Days has the value that exceeds 30...
 

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

Top