A
Addy
I have built a form that will run a query on click of the command
button. The query is pulling data from a table called Contracts.
In the Query I want to filter on a field called "Margin" Basically
I want to be able to see margins greater then 50%., less than n% and so
on and so forth.
On my form I have to controls, they are txt.Planned Margin and
combo_criteria.
On the text box a user can type in the value, and the combo allows them
to select the criteria like >,>=, <,<=, =.
For the queries parameter I have linked it back to the txt.Planned and
combo_criteria.
Problem is when I run this, nothing comes up with any value I enter.
I am guess its something with my operators (>,>=, <,<=, =.).
Here is the SQL.
SELECT [Modality Map].Modality, [Contract Cost Report].[Customer
Number], [Contract Cost Report].[Customer Name], [Contract Cost
Report].[Functional Location], [Contract Cost Report].[Functional Locn
Description], [Contract Cost Report].[Contract Start Date], [Contract
Cost Report].[Contract End Date], [Contract Cost Report].[Actual Margin
% YTD], [Contract Cost Report].[Planned Margin % YTD]
FROM [Modality Map] INNER JOIN [Contract Cost Report] ON [Modality
Map].[Cost ctr] = [Contract Cost Report].Modality
WHERE ((([Contract Cost Report].[Planned Margin %
YTD])=[Forms]![Contract Analysis]![ combo_criteria].[Text] &
[Forms]![Contract Analysis]![ txt.Planned].[Text]));
button. The query is pulling data from a table called Contracts.
In the Query I want to filter on a field called "Margin" Basically
I want to be able to see margins greater then 50%., less than n% and so
on and so forth.
On my form I have to controls, they are txt.Planned Margin and
combo_criteria.
On the text box a user can type in the value, and the combo allows them
to select the criteria like >,>=, <,<=, =.
For the queries parameter I have linked it back to the txt.Planned and
combo_criteria.
Problem is when I run this, nothing comes up with any value I enter.
I am guess its something with my operators (>,>=, <,<=, =.).
Here is the SQL.
SELECT [Modality Map].Modality, [Contract Cost Report].[Customer
Number], [Contract Cost Report].[Customer Name], [Contract Cost
Report].[Functional Location], [Contract Cost Report].[Functional Locn
Description], [Contract Cost Report].[Contract Start Date], [Contract
Cost Report].[Contract End Date], [Contract Cost Report].[Actual Margin
% YTD], [Contract Cost Report].[Planned Margin % YTD]
FROM [Modality Map] INNER JOIN [Contract Cost Report] ON [Modality
Map].[Cost ctr] = [Contract Cost Report].Modality
WHERE ((([Contract Cost Report].[Planned Margin %
YTD])=[Forms]![Contract Analysis]![ combo_criteria].[Text] &
[Forms]![Contract Analysis]![ txt.Planned].[Text]));