can you specifie criteria for a parameter query in an Auto Number.

L

Lea

I have created a parameter query, and specified criteria in an Auto Number
field (which is also the primary key) and when i run the query i get no
results. Why?
 
L

Lea

Ofer thank you very much for your help. I will try it.

Lea

Ofer said:
Try this
WHERE [2005 BuckSlips].[Number]=[Enter Number to Print:]
Or
WHERE [2005 BuckSlips].[Number]=cdbl([Enter Number to Print:])
Or
WHERE [2005 BuckSlips].[Number] Like cdbl([Enter Number to Print:])

--
I hope that helped
Good luck


Lea said:
SELECT [2005 BuckSlips].Number, [2005 BuckSlips].[Date Requested], [2005
BuckSlips].[Requested By], [2005 BuckSlips].Priority, [2005 BuckSlips].City,
[2005 BuckSlips].County, [2005 BuckSlips].[State Route], [2005
BuckSlips].[Mile Post], [2005 BuckSlips].Location, [2005
BuckSlips].Recommendations, [2005 BuckSlips].Completed
FROM [2005 BuckSlips]
WHERE ((([2005 BuckSlips].Number)=[Enter Number to Print:]));


Ofer said:
Can you post the SQL?

--
I hope that helped
Good luck


:

I have created a parameter query, and specified criteria in an Auto Number
field (which is also the primary key) and when i run the query i get no
results. Why?
 
J

John Vinson

I have created a parameter query, and specified criteria in an Auto Number
field (which is also the primary key) and when i run the query i get no
results. Why?

Probably because your query, or your criteria, are incorrect.

We can't see them, so we can't help. Care to open the query in SQL
view and help us to help you?

John W. Vinson[MVP]
 
V

Van T. Dinh

"Number" IS a reserved word in JET SQL.

Suggest you change the Field name to something else different from "Number".

Try the following SQL:

SELECT [2005 BuckSlips].[Number], [2005 BuckSlips].[Date Requested], [2005
BuckSlips].[Requested By], [2005 BuckSlips].Priority, [2005 BuckSlips].City,
[2005 BuckSlips].County, [2005 BuckSlips].[State Route], [2005
BuckSlips].[Mile Post], [2005 BuckSlips].Location, [2005
BuckSlips].Recommendations, [2005 BuckSlips].Completed
FROM [2005 BuckSlips]
WHERE ((([2005 BuckSlips].[Number])=[Enter Number to Print:]));

Note the square brackets around "Number".

HTH
Van T. Dinh
MVP (Access)



Lea said:
SELECT [2005 BuckSlips].Number, [2005 BuckSlips].[Date Requested], [2005
BuckSlips].[Requested By], [2005 BuckSlips].Priority, [2005
BuckSlips].City,
[2005 BuckSlips].County, [2005 BuckSlips].[State Route], [2005
BuckSlips].[Mile Post], [2005 BuckSlips].Location, [2005
BuckSlips].Recommendations, [2005 BuckSlips].Completed
FROM [2005 BuckSlips]
WHERE ((([2005 BuckSlips].Number)=[Enter Number to Print:]));


Ofer said:
Can you post the SQL?
 
Top