473,671 Members | 2,446 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Adding fiilters in reports.

47 New Member
Hi,

This is wierd.... I had given filters to a report and when a cmd button is clicked, the filtered report (Data having a particular date) is opened. This worked fine yesterday. but today it is not filtering the data in the report... Could someone tell me i have edited the coding by mistake?

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport "ReportName", acViewPreview, , "Date >= From_Date" & "< To_Date"
  2.  
Jun 20 '08 #1
3 1112
JKing
1,206 Recognized Expert Top Contributor
Hi,

This is wierd.... I had given filters to a report and when a cmd button is clicked, the filtered report (Data having a particular date) is opened. This worked fine yesterday. but today it is not filtering the data in the report... Could someone tell me i have edited the coding by mistake?

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport "ReportName", acViewPreview, , "Date >= From_Date" & "< To_Date"
  2.  
I think your where criteria is malformed.

You either want:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport "ReportName", acViewPreview, , "Date >= From_Date AND Date <= To_Date"
  2.  
  3. 'or alternatively if you are referencing controls on a form
  4.  
  5. DoCmd.OpenReport "ReportName", acViewPreview, , "Date >= #" & Me.From_Date & "# AND Date <= #" & Me.To_Date & "#"
  6.  
Jun 20 '08 #2
neosam
47 New Member
I think your where criteria is malformed.

You either want:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport "ReportName", acViewPreview, , "Date >= From_Date AND Date <= To_Date"
  2.  
  3. 'or alternatively if you are referencing controls on a form
  4.  
  5. DoCmd.OpenReport "ReportName", acViewPreview, , "Date >= #" & Me.From_Date & "# AND Date <= #" & Me.To_Date & "#"
  6.  
Dude,

You are a life saver......
Jun 20 '08 #3
JKing
1,206 Recognized Expert Top Contributor
Dude,

You are a life saver......
Haha,

You're welcome :)

Jared
Jun 21 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
11050
by: Scott | last post by:
Hello: I have a stored procedure for generating our invoices in Crystal Reports. I have added a new field to the SP, but when I try to add the field to my Crystal Report invoice, the field isn't available in the list. However, if I create a new, blank report using the same stored procedure as the datasource, the field is available. I've seemingly tried every iteration of "Verify Database" to no avail. The obvious answer would be to...
3
1801
by: Chris Minchin | last post by:
Hi there, I am a bit of a newboy to access I have a database which I wish to have pictures. for example: record one will have data and a picture, record two will have different data and a diferent picture. I am pretty sure that a picture bound frame is used, but are unable to make it work. Anybody able to help? Chris
3
1920
by: Mike Turco | last post by:
My phone directory project is moving along. Its a series of reports and documents that all get imported into Word, via RTF files or whatever. I need to create a couple of indexes. Is there a way to insert the index marks within a database report, such that when I export the file to RTF, word will recognize those indexes? Thanks, Mike
5
1615
by: Web Team | last post by:
Hi All, Can someone please explain how I go about adding a control (Say for example a panel) to a custom web control. I've tried this: Protected Overrides Sub Render(ByVal output As System.Web.UI.HtmlTextWriter) Dim EditPanel As New System.Web.UI.webcontrols.Panel EditPanel.Attributes.Add("contenteditable", "")
11
1483
by: Andy Chan | last post by:
First of all, thanks to Crirus and Fergus for helping me with a related posted a few days ago. Ok, I can add images to my form (for whatever reason I cannot added more than 1 image within the same procedure; rather I had to call the same "addimage" procedure over and over again to get it working). For anyone that's curious the code I used is the following: ----------------------------------------------------------------------------...
3
3659
by: Troy | last post by:
ok, I fat-fingered the Line control in the Crystal Reports tab of the toolbox and now its gone. I can still insert lines with a right-click, but where is the Line control? I found the LineObjectInstance in the object browser, inside .Shared...ViewerObjectModel but can't find any control in the customize toolbox window. How do I get the line control back or restore the Crystal Reports Tab? thx
0
1011
by: patang | last post by:
In my VB.Net Project, I have a couple of reports (first.rpt, second.rpt etc). Initially, when I created the reports I put them in the Solutions folder. Accidently I excluded the rpt files from the project. Now, the problem is that when I try to include again the report file then it creates another files e.g. first1.vb, second1.vb). My question is why it create these files. Why can't I just include the first.rpt and second.rpt files ? ...
2
1244
by: Mike Abbott | last post by:
A fairly recent convert to Access I have succeeded in getting it to work well on my current fairly simple requirements. Can someone help me with another step? I have three simple reports. Income / Expenses and Car Business Usage. These are mainly for the Tax office and I would like to add my name address
0
1189
by: SMcK | last post by:
I have a PDA database program that allows me to use a bitmap image as a background for a drawing field. Users can draw digital ink on top of the bitmap and save the new ink as an OLE object in the PDA database. The bitmap is not saved as part of the record, just the new ink. I'm looking for a way to print a report from the database that would recombine the bitmap and the ink. One way might be to import the PDA database into a desktop...
10
3744
by: AC | last post by:
I had a page that does some event setup on window.onload: function prepEvents() { document.getElementById("menumap_sales").onmouseover = swapMenuSales; // etc } window.onload = prepEvents;
0
8401
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8926
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8603
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8673
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7444
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6236
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2818
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2060
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.