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":
[TABLE="width: 500"]
<tbody>[TR]
[TD]Training[/TD]
[TD]Teacher[/TD]
[TD]Admin[/TD]
[TD]Senior Management[/TD]
[/TR]
[TR]
[TD]Safeguarding[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]First Aid[/TD]
[TD]1[/TD]
[TD]0[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]Fire marshall[/TD]
[TD]0[/TD]
[TD]1[/TD]
[TD]0[/TD]
[/TR]
</tbody>[/TABLE]
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":
[TABLE="width: 500"]
<tbody>[TR]
[TD]Training[/TD]
[TD]Teacher[/TD]
[TD]Admin[/TD]
[TD]Senior Management[/TD]
[/TR]
[TR]
[TD]Safeguarding[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]First Aid[/TD]
[TD]1[/TD]
[TD]0[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]Fire marshall[/TD]
[TD]0[/TD]
[TD]1[/TD]
[TD]0[/TD]
[/TR]
</tbody>[/TABLE]
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