Re: parameter query not prompting for parameter



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" wrote:

> 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" <TomBrophy@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:68CB628E-43DD-48CA-BBCB-BBEFEA49ACA8@xxxxxxxxxxxxxxxx
> >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
> >
>
>
>
.



Relevant Pages

  • Programatically Changing Query Criteria
    ... Save your query in SQL. ... the following to determine your criteria. ... Dim strSQL As String ... MsgBox "There was a problem building the SQL String" ...
    (microsoft.public.access.macros)
  • Re: Complex query criteria - desperate appeal
    ... I made an ASP website using an Access DB ... criteria listboxes have the ALL choice, and the value passed to the query is ... I then build a string of the selected ID's and use ...
    (microsoft.public.access.queries)
  • Re: Passing multiple strings from a text box to a select query
    ... Search Criteria database page on your website have given me lots of new ... Will a filtered form allow a subform that displays records from a query ... The article explains how to create the string to use as the WhereCondition ... This allows me to enter "seat" in the text box and return ...
    (microsoft.public.access.forms)
  • Re: Email Merge in Word
    ... Different software packages can treat "null", "a string set to ''", and "a string containing white space differently, and may also treat variable-length and fixed-length data differently in this respect. ... Also, when I set up my query, I selected the criteria for the email address field "is not null", and there are still some blank records with no emails. ...
    (microsoft.public.word.mailmerge.fields)
  • RE: List Box and Query
    ... I would not put any criteria in qry_Suppliers. ... build up a Where string and then apply that "WHERE" criteria to a Select ... Query (qrySupplierTEST) to get my desired records. ...
    (microsoft.public.access.formscoding)