Query Generation from Form inputs

R

rdwest01

I have a report that uses the entry arguments of Last Name & MOC from a form
to generate the report. However, I can't get the query (and hence the
report) to use both arguments to create the report. It works fine with only
one varialbe selected.
The SQL info for the query is below:

SELECT [Buff Flt Personnel].[Primary Key], [Buff Flt Personnel].[Last Name],
[Buff Flt Personnel].[First Name], [Buff Flt Personnel].Initials, [Buff Flt
Personnel].Rank, [Buff Flt Personnel].MOC, [Buff Flt Personnel].COS, [Buff
Flt Personnel].Component, [Buff Flt Personnel].ServiceNo
FROM [Buff Flt Personnel]
WHERE ((([Buff Flt Personnel].[First Name])=[Forms]![Locate Readiness Report
Form]![Last Name]) AND (([Buff Flt Personnel].MOC)=[Forms]![Locate Readiness
Report Form]![MOC]))
ORDER BY [Buff Flt Personnel].[Last Name];

How do I get to to choice both the Last Name & MOC to produce the report for
that one person?
 
D

Duane Hookom

Your query criteria compares the form/control value to the [First Name]
field rather than [Last Name].
 
R

rdwest01

Duane

Awesome. Couldn't see the forest for the trees!

Duane Hookom said:
Your query criteria compares the form/control value to the [First Name]
field rather than [Last Name].

--
Duane Hookom
MS Access MVP


rdwest01 said:
I have a report that uses the entry arguments of Last Name & MOC from a
form
to generate the report. However, I can't get the query (and hence the
report) to use both arguments to create the report. It works fine with
only
one varialbe selected.
The SQL info for the query is below:

SELECT [Buff Flt Personnel].[Primary Key], [Buff Flt Personnel].[Last
Name],
[Buff Flt Personnel].[First Name], [Buff Flt Personnel].Initials, [Buff
Flt
Personnel].Rank, [Buff Flt Personnel].MOC, [Buff Flt Personnel].COS, [Buff
Flt Personnel].Component, [Buff Flt Personnel].ServiceNo
FROM [Buff Flt Personnel]
WHERE ((([Buff Flt Personnel].[First Name])=[Forms]![Locate Readiness
Report
Form]![Last Name]) AND (([Buff Flt Personnel].MOC)=[Forms]![Locate
Readiness
Report Form]![MOC]))
ORDER BY [Buff Flt Personnel].[Last Name];

How do I get to to choice both the Last Name & MOC to produce the report
for
that one person?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top