Re: Report on a selected field value

Tech-Archive recommends: Speed Up your PC by fixing your registry



It's good to hear that it's working.

One way to figure out which quotes are where is to click in
their area and use the right and left arrow keys to move
through them one character at a time.

As I kind of implied earlier, I personally prefer the syntax
that you chose to use for the same reason. The only way
that could cause a problem is if the value in EIIList
contained a double quote character, which should be extemely
unlikely.
--
Marsh
MVP [MS Access]


Aaron wrote:

Marshall Barton wrote:
When you post code with a question, please use Copy/Paste so
we don't waste time chasing typos.

You have some errors in the posted code. First, the quotes
are wrong. If EII_Acronym is a text field, it should be:
strWhere = "[EII_Acronym] = '" & EIIList & "' "
or if EII_Acronym might possible contain an apostrophe, use:
strWhere = "[EII_Acronym] = """ & EIIList & """ "

Bingo! This one did it. The one before probably would work, but I
couldn't figure out where the apostrophes and quotes began and ended...
I hope the second one won't cause errors.

Thank you thank you thank you!


If EII_Acronym is a mumeric type field, use:
strWhere = "[EII_Acronym] = " & EIIList

The other error I spotted is the wrong number of commas in
the OpenReport line:
DoCmd.OpenReport "EII_Report", acViewPreview, , strWhere

.



Relevant Pages

  • Re: delimiters, sql, joins, AHHH!
    ... To decide whether or not to delimit the data, look at the datatype of the ... means you MUST NOT delimit the data by putting quotes around it. ... the data contains an apostrophe, then you must replace the apostrophe with ... you don't have to escape the apostrophe in O'Malley when you use ...
    (microsoft.public.inetserver.asp.general)
  • Re: strange table behavior
    ... I will look at my table again and see if the apostrophe is the cause ... I think I will change all text delimiters to double quotes as you ... Joanne wrote: ... CoNameID CoName ...
    (microsoft.public.access.formscoding)
  • Re: search and replace symbols
    ... WP Typographic Symbols font for them, and you do not have that font ... In the "Replace with" box type an apostrophe or quote symbol. ... the non-curley varieties come up with @ and = signs. ... > them as apostrophe or quotes, so I have about 200 pages to do by hand. ...
    (microsoft.public.word.docmanagement)
  • Re: Picklists in Crystal Enterprise with apostrophe
    ... is the .csp written in vbscript or another scripting ... the string that contains the apostrophe ... replacement surrounded by double quotes. ...
    (microsoft.public.vb.crystal)
  • Re: Database SQL query
    ... Note the use of double quotes in the "%s" format string instead of single ... >> a field which contains a word with a single apostrophe ie (St. ... >> MFC. ...
    (microsoft.public.vc.mfc)