'MS Access - Selecting which table to merge

Is there a way to choose which table do I merge using SQL in MS Access through entering parameter value?

Let's say I have 3 tables: Users, 2021 and 2022.

Any my query is:

SELECT 
    Users.code, 2021.consumption
FROM 
    Users  
INNER JOIN 
    2021 ON Users.code = 2021.code
WHERE 
    (((Users.code) = [Insert the user code]))

I get "Enter Parameter Value" window to filter the code that I want to check, but I would like to get the same to choose other table (2022)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source