Strange Problem with a Query

  • Thread starter Thread starter James
  • Start date Start date
J

James

I've been using access for two years so queries are not a
problem for me, however I have tried to write a query that
filters information from one table based on the
information displayed on an active form. This information
is then displayed in a subform. Only one column will
sort, I've checked the table format as well as the column
formats and they are the same as the master table that the
form gets it's information from. Below is the SQL
queries, the top one works and the bottom doesn't. I'm
pulling what little hair I've got trying to figure this
one out.

SELECT AsscoTable.SSAN, AsscoTable.AFSC, AsscoTable.AEF,
AsscoTable.UTC, AsscoTable.ULN, AsscoTable.AFSCPre,
AsscoTable.Grade, AsscoTable.SEI, AsscoTable.UTCLineNumber
FROM AsscoTable
WHERE (((AsscoTable.AFSC)=Forms!NewAssoForm!Text5))
ORDER BY AsscoTable.AEF;



SELECT AsscoTable.SSAN, AsscoTable.AFSC, AsscoTable.AEF,
AsscoTable.UTC, AsscoTable.ULN, AsscoTable.AFSCPre,
AsscoTable.Grade, AsscoTable.SEI, AsscoTable.UTCLineNumber
FROM AsscoTable
WHERE (((AsscoTable.SSAN)=[Forms]![NewAssoForm]![Text12]));
 
James,

Apart from "doesn't work", what else can you tell us about the
problem?

- Steve Schapel, Microsoft Access MVP
 
The "doesn't work" problem has me running in circles.
When I run the first query, the query will return the
filtered information just as a query should. When I run
the second query there is just one row of blank spaces, no
data. It's as if no data was selected, or the query did
not understand the filter that feeds off the active form.
I've checked the formating of the form text field as well
as the formating of each tables, they all match.

-----Original Message-----
James,

Apart from "doesn't work", what else can you tell us about the
problem?

- Steve Schapel, Microsoft Access MVP


I've been using access for two years so queries are not a
problem for me, however I have tried to write a query that
filters information from one table based on the
information displayed on an active form. This information
is then displayed in a subform. Only one column will
sort, I've checked the table format as well as the column
formats and they are the same as the master table that the
form gets it's information from. Below is the SQL
queries, the top one works and the bottom doesn't. I'm
pulling what little hair I've got trying to figure this
one out.

SELECT AsscoTable.SSAN, AsscoTable.AFSC, AsscoTable.AEF,
AsscoTable.UTC, AsscoTable.ULN, AsscoTable.AFSCPre,
AsscoTable.Grade, AsscoTable.SEI, AsscoTable.UTCLineNumber
FROM AsscoTable
WHERE (((AsscoTable.AFSC)=Forms!NewAssoForm!Text5))
ORDER BY AsscoTable.AEF;



SELECT AsscoTable.SSAN, AsscoTable.AFSC, AsscoTable.AEF,
AsscoTable.UTC, AsscoTable.ULN, AsscoTable.AFSCPre,
AsscoTable.Grade, AsscoTable.SEI, AsscoTable.UTCLineNumber
FROM AsscoTable
WHERE (((AsscoTable.SSAN)=[Forms]![NewAssoForm]!
[Text12]));

.
 
James,

SSAN doesn't happen to be a Lookup field, does it?

- Steve Schapel, Microsoft Access MVP
 
Back
Top