Is there a way to select/specify the table to be used in a select query from a combo box on a form? For example, I have a combo box that displays the existing database objects - tables (2006_13, 2006_14, 2006_15, etc.) and I'd like the user to be able to run a select query that returns all values in the table they previoulsy selected from the combo box (2006_13).
The selected table name (2006_13, 2006_14, 2006_15, etc.) exists in the form control and also in a make table that's created when the user makes their selection.
Depends on what you want to do, but it must be built in VBA. You can't have that in the query itself. You could use QueryDef to set the SQL of a saved query to that, or set the source of a subform to it, or whatever.
However, I have to say I don't like the design. Typically payroll data would be stored in one table, with specific pay period data either drawn out based on dates or via a field that specified which pay period it was for. What do you do when you want the data for a month, quarter, year or whatever?