473,407 Members | 2,315 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Where Clause in OpenForm statement

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

Jun 30 '06 #1
3 2732
On Fri, 30 Jun 2006 14:18:30 GMT, "Mike Charney"
<no*****@everything.net> wrote:

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.

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


Jun 30 '06 #2
"Mike Charney" <no*****@everything.net> wrote in
news:Wo*********************@newssvr21.news.prodig y.com:
I am having trouble with the where clause in an openreport
statement in an Access Data Project.

DoCmd.OpenReport "rptAllRecords", acViewPreview, , "[active]="
'True'

When I hit the button that is supposed to open the report I
get the following error:
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.

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Jun 30 '06 #3
Thanks Tom, that did the trick.

Mike Charney

"Tom van Stiphout" <no*************@cox.net> wrote in message
news:7i********************************@4ax.com...
On Fri, 30 Jun 2006 14:18:30 GMT, "Mike Charney"
<no*****@everything.net> wrote:

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.

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

Jun 30 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

47
by: Andrey Tatarinov | last post by:
Hi. It would be great to be able to reverse usage/definition parts in haskell-way with "where" keyword. Since Python 3 would miss lambda, that would be extremly useful for creating readable...
4
by: Tom Walker | last post by:
I cannot get the WHERE statement to work correctly unless I use a literal with the LIKE. I want to use a working storage data name so that I can vary the WHERE statement. Example that works: ...
3
by: Lyn | last post by:
Hi, I have a Search input form which collects from the user a person's name. I am using LIKE with a "%" suffix in the SQL so that the user does not have to type in the full name. When they hit...
8
by: John Welch | last post by:
I have a command button with the following code: DoCmd.OpenForm "frmSearchAssignments", , , "SearchAssignmentID = 1" (SearchAssignmentID is the PK, auto number) When it runs, the form opens but...
3
by: griffiji | last post by:
Ok, I have read this group until I think my eyes are ready to bleed, so I would be most appreciative of some help. I have a form, on it are 3 combo boxes, and 3 text boxes I have 1 table, with...
8
by: Mike Charney | last post by:
I am trying to write an Open Form command in VBA with a where clause in it. I need to be able to do two different where clauses: 1) With a between in it: i.e. Between Date1 and Date2 or...
8
by: chrisdavis | last post by:
I'm trying to filter by query or put those values in a distinct query in a where clause in some sort of list that it goes through but NOT at the same time. Example: ROW1 ROW2 ROW3 ROW4 ,...
14
by: keri | last post by:
Hi, Simple version of the question..... How do I use the where clause of the open form command to show an account with a matching ID to be displayed when the form is opened? Eg. I select a...
6
by: Plissskin | last post by:
I need to create an "ad-hoc" filtering page in a web app we are building. The page would display a number of drop down lists, text boxes, and radio lists and allow the user to select (enter) some...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.