Forms running a query

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

James

I am having a problem with a query that filters from data
on an active form. Here is the queries:

This Works

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;


This Doesn't

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]));

I can't figure out why one query works and why another
doesn't. Is there some formating on the form that I'm
missing?
 
How is the data in Text12 formatted and how is the data in SSAN formatted?
Is SSAN a text datatype or number; if it is number, it should be changed to
text.

Also why did you surround Text12 with [ ] and not Text5? If you remove the
[] will the other query work?
 
I've tried to remove the [ ] from the Text12 and ran both
queries again, no joy.

I've checked the format of the fields SSAN on the form as
well as the tables. Still no joy. I've even copied the
Text5 box and switched the data source to SSAN, modified
my query. No joy.

Still looking for the solution. Thanks!

-----Original Message-----
How is the data in Text12 formatted and how is the data in SSAN formatted?
Is SSAN a text datatype or number; if it is number, it should be changed to
text.

Also why did you surround Text12 with [ ] and not Text5? If you remove the
[] will the other query work?

James said:
I am having a problem with a query that filters from data
on an active form. Here is the queries:

This Works

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;


This Doesn't

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]));

I can't figure out why one query works and why another
doesn't. Is there some formating on the form that I'm
missing?


.
 
Back
Top