Javatpoint Logo
Javatpoint Logo

And Function in MS Access

In this module, we will learn to implement the And function in MS Access. We will learn the proper syntax, and discuss some examples to clearly understand the concept.

And function in MS Access is similar to the And keyword in any other programming language. That is, it is used with conditions. It is used to check multiple conditions simultaneously. If all the conditions are TRUE, then the statement will evaluate TRUE. But if any of the conditions is FALSE, then the statement will return FALSE too.

Syntax of And function

The expression evaluates to a boolean value, i.e., the expression can either return True or False as the value.

Value Returned after evaluating all the Conditions

True: The And function will only return True if all the conditions are evaluated as True.

False: The And function will return False if any of the conditions are evaluated as False in the function.

The And function can only be implemented in the following versions of MS Access:

Access 2019, Access 2016, Access 2013, Access 2010, Access 2007, Access 2003, Access XP, Access 2000

Implementing the And function in the VBA code

The syntax that we will be using in the below examples is only applicable in the Visual Basic Application Code in MS Access:

Here, we have implemented the And function with the If statement to clarify the difference in the Result.

If this would set the Result variable to "High" if both the conditions are True, if any of the one condition is false, then the value assigned to the Result will be "Low".

If this would set the Result variable to "Pass" if both the conditions are True, if any of the one condition is false, then the value assigned to the Result will be "Fail".

If this would set the Result variable to "Big Set Up" if both the conditions are True, if any of the one condition is false, then the value assigned to the Result will be "Small Set Up".







Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA