I am having trouble with the where clause in an openreport statement in an
Access Data Project.
I am using MS-Access 2003 with SQL Svr 2000.
The line I am using is:
DoCmd.OpenReport "rptAllRecords", acViewPreview, , "[active]=" 'True'
When I hit the button that is supposed to open the report I get the
following error:
Run-Time error '30025':
Invalid SQL Statement. Check the server filter on the form record source.
I have built the report directly form the table, not from a sql statment or
view.
Does anyone know what the problem is?
Thanks,
Mike
m charney at dunlap hospital dot org
Bob Quintal - 30 Jun 2006 14:56 GMT
> I am having trouble with the where clause in an openreport
> statement in an Access Data Project.
[quoted text clipped - 6 lines]
>
> Does anyone know what the problem is?
"[active] = " 'true' has a doublequote wrong.
if active is a text field withe the word true in it, then
"[ACTIVE] = 'true'"
if it's a boolean field,
"[ACTIVE] is true" OR "[active] = 1" will work
"[active] = true" also works in JET SQL, not sure about server.

Signature
Bob Quintal
PA is y I've altered my email address.
--
Posted via a free Usenet account from http://www.teranews.com
Tom van Stiphout - 30 Jun 2006 15:35 GMT
I would think this would not even compile.
Try:
"[active]=1"
Note that True is -1 in VBA, and a True bit field in SQL Server is +1.
-Tom.
>I am having trouble with the where clause in an openreport statement in an
>Access Data Project.
[quoted text clipped - 19 lines]
>Mike
>m charney at dunlap hospital dot org
Mike Charney - 30 Jun 2006 16:22 GMT
Thanks Tom, that did the trick.
Mike Charney
> I would think this would not even compile.
>
[quoted text clipped - 29 lines]
>>Mike
>>m charney at dunlap hospital dot org