Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / June 2006

Tip: Looking for answers? Try searching our database.

Where Clause in OpenForm statement

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike Charney - 30 Jun 2006 15:18 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.