or or or Question

edkocol

Registered User.
Local time
Today, 03:21
Joined
Oct 2, 2012
Messages
30
Code:
If Me!ClientID = 147 Or 151 Or 187 Or 189 Or 190 Or 191 Or 193 Or 197 Or 198 Or 199 Then
 .... do something
End If

Is this the corrrect way to limit the "do something" action to take place for the desired 10 clients?

What is happening is clients other than the 10 in the list are performing the "do something".

This event is on a fields "after update" in a subformB that has a one to one relationship to another subformA that has "n" number of entries (some for the desired 10 clients and other clients as well).

I know hard coding client IDs is kind of lame but that's what it is for now.
 
Last edited:
Also is there a similar function like Oracle's "in" list function

i.e.

"If Me!ClientID in (147, 151 ....)"
 
You statement needs to use the following syntax;
Code:
If Me!ClientID = 147 Or Me!ClientID = 151 Or Me!ClientID = 187 Or Me!ClientID = 189 Or Me!ClientID = 190 Or Me!ClientID = 191 Or Me!ClientID = 193 Or Me!ClientID = 197 Or Me!ClientID = 198 Or Me!ClientID = 199 Then
 .... do something
End If
 
Or

Select case me!ClientID
case 147,151,187,189,190,191,193,197,198,199
.... do something
case else
...
end select
 
alternatively, if there is some special attribute about these clients - add an extra field to the client table to distinguish them

so you can say

if clientsize = "major account" then
(note this is for illustration - in actual use you ought to use a numeric value, rather than a text string)


this is better, as otherwise you will find yourself forever changing the criteria to reflect new customer accounts. By using a different attribute, you just change the DATA, rather than having to change the app.
 

Users who are viewing this thread

Back
Top Bottom