parameter query not prompting for parameter

parameter query not prompting for parameter

Post by VG9tIEJyb3 » Thu, 11 Aug 2005 02:55:03


I am trying to create a parameter query to let me enter the sales person I
want to query. However, it isn't prompting and it doesn't show any records
(like it's taking the parameter literally as a string).

Here is the SQL query:
SELECT City, SalesPerson, Contact, Company, Building, SqFeet, ID
FROM dbo.tblOpportunity
WHERE (SalesPerson = '[Sales Person]')

I'm using Access 2003 but with 2000 file format. The tables are SQL and not
access tables.

Any help would be appreciated.

Thanks,

Tom Brophy
 
 
 

parameter query not prompting for parameter

Post by Duane Hook » Thu, 11 Aug 2005 03:00:38

Since your parameter is inside string delimiters, it is "taking the
parameter literally as a string". Try removing the single quotes.

Better yet, us a control on a form as a criteria in your query. You could
then use a combo box of SalesPerson values.

--
Duane Hookom
MS Access MVP

 
 
 

parameter query not prompting for parameter

Post by VG9tIEJyb3 » Thu, 11 Aug 2005 03:19:06

The single quotes were actually put in there by Access when I entered the
'criteria', and even if I try to remove the single quotes it puts it right
back in. if I remove the single quotes directly from the SQL statement and
try to save the query, I get:
ADO error: Invalid column name 'Sales Person' (without brackets).

I cannot use the combo box because this is intended for a web page and I am
trying to pass the parameter into the query so they see their items and
nothing else. Also, when they query a specific item, I have to show the
detail items and that means I need to pass other parameters as well (IDs,
etc) - so I really have no choice but to get this working.

Thanks for your quick reply the last time. Any other ideas?

Tom Brophy
 
 
 

parameter query not prompting for parameter

Post by Duane Hook » Thu, 11 Aug 2005 07:31:41

I'm sorry but I didn't know this was ADO or for a web page.

I believe this might be an ASP question?

--
Duane Hookom
MS Access MVP