Hi
Just wondering, as the title suggests how to write a query that - based on what is entered on a form - dynamically refers to a column heading in a table. So:
I have a table called "Required training":
<tbody>
</tbody>
I have a form where I want the end user to be able to select "teacher" (for example), run a report which will be linked to the query, and see a report of all the training that a teacher is required to do. I know how to link the report to the query from within the form, my problem is I don't know how to make the query dynamic so that whatever is selected from the drop-down box on the form will be returned by the query i.e.
Select [column name from form drop-down]
From tblRequiredTraining
Where [colum name from form drop-down] = 1
Any help would be appreciated, let me know if I can do anything to make it clearer
Thanks
Just wondering, as the title suggests how to write a query that - based on what is entered on a form - dynamically refers to a column heading in a table. So:
I have a table called "Required training":
Training | Teacher | Admin | Senior Management |
Safeguarding | 1 | 1 | 1 |
First Aid | 1 | 0 | 0 |
Fire marshall | 0 | 1 | 0 |
<tbody>
</tbody>
I have a form where I want the end user to be able to select "teacher" (for example), run a report which will be linked to the query, and see a report of all the training that a teacher is required to do. I know how to link the report to the query from within the form, my problem is I don't know how to make the query dynamic so that whatever is selected from the drop-down box on the form will be returned by the query i.e.
Select [column name from form drop-down]
From tblRequiredTraining
Where [colum name from form drop-down] = 1
Any help would be appreciated, let me know if I can do anything to make it clearer
Thanks