473,513 Members | 2,601 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 1101
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
11035
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...
3
1791
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...
3
1904
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...
5
1607
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...
11
1473
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...
3
3641
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...
0
1001
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...
2
1238
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. ...
0
1180
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...
10
3729
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
7259
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
7158
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...
1
7098
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
5683
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,...
1
5085
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...
0
3232
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...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1592
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 ...
1
798
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.