Me. statements not working

RaptureReady

Registered User.
Local time
Today, 13:10
Joined
May 7, 2007
Messages
30
Hey all, I am trying to write a me. statement that has more than one condition, is this possible?

Here is what I have, oh and btw I'm learning access if you could not tell...:):

Code:
Private Sub Product_LostFocus()
If Me.Product = "1" or "3" or "7" or "12" or "Large" Then
Me.stocked = True
Else
Me.stocked = False
End If
End Sub
[\code]
 
Thanks for the help.
RR
 
Try Me.Product.Value = "1" or "3" or "7" or "12" or "Large" Then
Me.stocked = True
Else
Me.stocked = False
End If
End Sub
[\code]


Not sure but may need the .value on the "stocked" portion as well.
 
Thank you for the reply. I tried that and it did not work.
 
Is there anyway you can zip and post your database? What version are you working in?
 
Use Select Case

Code:
Private Sub Product_LostFocus()

Select case Me.Product

case "1" ,"3", "7" ,"12","Large" 
           Me.stocked = True
Case Else
           Me.stocked = False
End Select

Brian
 
For general info, your problem was in not repeating the field:

If Me.Product = "1" or Me.Product = "3" or Me.Product = ...
 
For general info, your problem was in not repeating the field:

If Me.Product = "1" or Me.Product = "3" or Me.Product = ...

lol...I actually did that and it worked, but then I saw Brian's post and decided to use it.

God bless all!
 
I am glad that you were able to get everything working. :)
 

Users who are viewing this thread

Back
Top Bottom