Please Please Help...I'm Going Insane!
Oct 1, 2004Hi,
I am trying to code some reports in Access 2000, but I have a problem. Here is the situation - I have a form which is made up of two tabs. On one of the tabs, there is a subform. It is this subform which I would like to run my reports from. The idea is that the user selects a value from a drop down combo box and then clicks a button, at which point a report runs. The report needs to take the value from the combo box and use it in the query. I have written the following query which runs when the report loads. The problem I have is that it does not recognise the form control that is referred to. I know that doing this on a form rather than subform works fine, but this does not. Does anyone know of a work around, without me having to re-design my screens without subforms. Thanks!
SELECT LU_GPPractices.Practice, GP_Objectives.[Objective Num], GP_Actions.[Action Desc], GP_Actions.Timescale, GP_Actions.Status, LU_Objectives.[Key Resp], GP_Actions.[Completed Date]
FROM (GP_Objectives INNER JOIN (GP_Actions INNER JOIN LU_Objectives ON GP_Actions.[Objective Num] = LU_Objectives.[Objective Num]) ON (GP_Objectives.[Objective Num] = GP_Actions.[Objective Num]) AND (GP_Objectives.[Practice Code] = GP_Actions.[Practice Code])) INNER JOIN LU_GPPractices ON GP_Actions.[Practice Code] = LU_GPPractices.[Practice Code]
WHERE (((LU_Objectives.[Key Resp])=[Forms]![FrmTabMenu]![FrmSearch].[ComboKey]) AND ((GP_Actions.[Completed Date]) Is Null))
ORDER BY LU_GPPractices.Practice, GP_Objectives.[Objective Num], GP_Actions.Timescale;