pop-up form to filter report
From: Leasha (anonymous_at_discussions.microsoft.com)
Date: 04/28/04
- Next message: anonymous_at_discussions.microsoft.com: "pop-up form to filter report"
- Previous message: Leasha: "The specified field name could refer to more than one table listed in the from clause of your SQL statment"
- In reply to: Lisa Reber: "pop-up form to filter report"
- Next in thread: anonymous_at_discussions.microsoft.com: "pop-up form to filter report"
- Reply: anonymous_at_discussions.microsoft.com: "pop-up form to filter report"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 27 Apr 2004 17:23:34 -0700
First try this, when writing sql code use double quotes to
denote the sql query text and single quotes for string
variables. John is right about the need to lose the
quotes around numeric variables. Another problem may be
the question mark in the field name ([Tagged?]). Symbols
are not recommended for use in field names as they are
often reserved. Put them in the label text on the form or
report only. In the case of the question mark it is a wild
card for a single character. So, having covered all that
the sql code should look something like:
"([Tagged?] =-1)"
"([VendorName] = 'XXXX')" or
"([VendorName] = " & 'XXXX' & ")"
with spaces whereever necessary to fulfill the
requirements of the syntax.
Good luck.
>-----Original Message-----
>Hi - Have downloaded the sample database "RptSmp97.mdb".
>It includes a nifty sample "Setting Filter/Filter On
>from a pop-up form"
>1) I've copied this with partial success.
>2) I know basically nothing about SQL.
>3) The fields I want to select by are combo boxes.
>
>Had posted this on 4/21 under the Forms group and got a
>good answer from John Vinson, but he was unable to reply
>to my latest post.
>
>The report source query is:
>SELECT DISTINCTROW Products.ProductName,
>Suppliers.SupplierCode, Products.VendorPart,
>Categories.CategoryName, Products.UnitPrice,
>Products.SellPrice, Products.[Tagged?]
>FROM Suppliers INNER JOIN (Categories RIGHT JOIN Products
>ON Categories.CategoryID = Products.CategoryID) ON
>Suppliers.SupplierID = Products.SupplierID
>ORDER BY Products.ProductName;
>
>I want to be able to filter by "supplier" and/or
>"category" and/or "tagged?" but because(?) they are combo
>boxes, I get the error message
>
>Syntax error (missing operator) in query
>expression '([Tagged?] ="-1" A)'.
>
>or some variation of it.
>JOhn's reply was "Lose the quote marks. They work when the
>field is a String but are prohibited when the field is
>numeric." I"ve been trying, but wonder which quote marks?
>I'm now getting the same message no matter which filter
>I try to use. "Tagged?" is a yes/no field, so Access
>considers it 0,-1. I eliminated that option, and I get
>Syntax error (missing operator) in query
>expression '([VendorName] ="XXXX" A)'. Is this because
the
>vendor name combobox shows my alpha vendor ID, it is
still
>askingfor numeric data, i.e. vendor ID autonumber?
>
>Can anybody out there please help? Thanks in advance.
>
>Regards, Lisa
>
>.
>
- Next message: anonymous_at_discussions.microsoft.com: "pop-up form to filter report"
- Previous message: Leasha: "The specified field name could refer to more than one table listed in the from clause of your SQL statment"
- In reply to: Lisa Reber: "pop-up form to filter report"
- Next in thread: anonymous_at_discussions.microsoft.com: "pop-up form to filter report"
- Reply: anonymous_at_discussions.microsoft.com: "pop-up form to filter report"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|