parameter query not prompting for parameter

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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.
 
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




Duane Hookom said:
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


Tom Brophy said:
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
 
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
--

Tom Brophy said:
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




Duane Hookom said:
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


Tom Brophy said:
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
 
Back
Top