Create a control in which the user selects the month and year they want to view and plugs it into a field, say fldMonth, fldYear; or a fldDate if you keep them combined.
table_name = "M" & fldYear & fldMonth
or
table_name = "M" & right(fldDate,4) & left(fldDate,2)
Create your query in VBA as:
"SELECT * " & _
"FROM " & table_name & " " & _
"WHERE ..."
Should work I think.
Edit: Can also use listboxes to select the Month/Year.
|