Using Access VBA we need to do an IF-Than statement but there are 16 values. So, I have tried including "OR" but this code returns error "Can't find the field 'I' referred to in the expression. Here is what we have: Note: the fields are on a subform f_SubReviewer:: If (Me![f_SubReviewer]![ReviewerComments] <> "" Or [Adj1] <> "") Than...
|
closed as not a real question by Oliver Salzburg♦ Sep 11 '12 at 23:10
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.
|
This sounds as if an A quick search show that MS Access has a case statement, with the following syntax:
Select Case test_expression
Case condition_1
result_1
Case condition_2
result_2
...
Case condition_n
result_n
Case Else
result_else
End Select
That would result in more readable code, which might also be faster. An example of using switch and case vs if (using C like syntax since I know that one)
If( (A=1) | (A=2) | (A=3) )
{
Do something
}
Else
{
Do something else
}
switch( A )
{
case 1: {Do something} ; break
case 2:
case 3: {Do something} (A might be 2 or 3 since there was no break behind 2); break.
Default: {Do something else}
}
|
|||
|
|
|
It looks like you're trying to check several fields/variables to make sure none is empty or null. In this case, you could do a whole bunch of nested
If the |
||||
|
|
