Access: If-Then function simply explained
Related Videos: Excel VBA IF THEN Statement (with ELSEIF & Looping in cells) (May 2024).
With Microsoft Access, you can quickly create a local database at home. In this practical tip, we have explained the if-then function in Access in an understandable manner.
If-Then function in Microsoft Access simply explained
The if-then function breaks down the three sections and looks like this: if ("condition"; "if true"; "if false").
- Under the item "condition" a condition has to be inserted which will be fulfilled later or not fulfilled.
- If the condition is met, the "if true" part is executed.
- If the condition from point one is not met, the last part, ie the "If wrong" part, is carried out.
Example of if-then function in Access
An if-then function in a query might look like this:
- = IF ([age]> = 18; "adult"; "underage")
- If the age in the "Age" column is greater than 18, the value "adult" is returned. If this is not the case, "Not of legal age" is returned.