473,396 Members | 1,968 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,396 software developers and data experts.

Report from Query

30
I am not seeing how to accomplish this:
I created a from that uses a subform, the main form has two fields, category and date.
After I select a category and date, the appropriate records show in the sub form
I would like to know how I can send this data to a report that I created using the subform data.
Right now when I produce the report it displays all the records, I would like to filter the report using the my form/subform data.
Thanks
JAS
Dec 30 '08 #1
6 1420
DonRayner
489 Expert 256MB
In the record source for your report, Add criteria for your for your catagory and date. Base the criteria on your form. The code for the criteria would be something like below or you could just use the expression builder.

Expand|Select|Wrap|Line Numbers
  1. [forms]![YourFormName]![YourFieldName]
  2.  
Replace YourFormName with the name of your form. Replace YourFieldName with the name of the field that you are basing the criteria on.
Dec 31 '08 #2
jas2803
30
I tried this but I keep getting [forms]![ScheduleLookup]![date] does not exist
(where Schedulelookup is my form and date is the field on the form

Is there maybe just a way to filter? where I can filter the report based on the two fields on my main form to return the data in the subform?

Thanks
Dec 31 '08 #3
jas2803
30
I even tried this
strFilter = "[date]=" & Me![date] & " and [category] ='" & Me![category] & "'"
stDocName = "Schedule"
DoCmd.OpenReport stDocName, acPreview, , strFilter

But when I run the report I still get every record.
The immediate's window show the correct date and category
Dec 31 '08 #4
DonRayner
489 Expert 256MB
Is your form open?

Using "Date" as a field name is probally what's causing the problem. Date is a reserved word in access that represents the current date. You should change the field name on your form to something else like ScheduleLookupDate or whatever.
Dec 31 '08 #5
jas2803
30
strFilter = "[date]=#" & Me![date] & "# and [category] ='" & Me![category] & "'"
Dec 31 '08 #6
NeoPa
32,556 Expert Mod 16PB
The format for the OpenReport method is :
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport(ReportName, _
  2.                  View, _
  3.                  FilterName, _
  4.                  WhereCondition, _
  5.                  WindowMode, _
  6.                  OpenArgs)
Naturally you would expect the FilterName parameter to be what you need. It isn't!!

Set up a WhereCondition string which is like a SQL WHERE clause but without the "WHERE" keyword.

PS. It's not a good idea to get into the habit of updating the design of an object (report) simply to apply filtering.
Jan 7 '09 #7

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

Similar topics

1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
3
by: Grim Reaper | last post by:
I know this is probably an easy question, but I could not find/figure it out. Basically, I am printing mailing labels with a "Sorting/Grouping" section that groups the label types together....
6
by: Mike Conklin | last post by:
This one really has me going. Probably something silly. I'm using dcount for a report to determine the number of different types of tests proctored in a semester. My report is based on a...
15
by: Richard Hollenbeck | last post by:
I tried to ask this question before on the 14th of January but I never got a reply. I'm still struggling with the problem. I'll try to rephrase the question: I have a crosstab query with rows...
2
by: Tom | last post by:
This is related to an earlier post entitled "Text in Query/Numbers in Report" Brief recap - report has a query as a record source. The query shows the correct data, the report translating the...
1
by: lorirobn | last post by:
Hi, I have a report that works just fine. Now I would like to add the capability to choose selection criteria to limit what is displayed. I created several reports that do this, but they used...
10
by: john | last post by:
I have a report to print envelopes. The report is based on a query. Now I need to make 10 more queries to make different selections of addresses. Every query has the same output fields as the...
4
by: lorirobn | last post by:
Hi, I have a report displaying items that are missing from a room. I created 2 queries, the first getting the items IN the room, and the second being an "unmatched" query that references the...
3
by: creative1 | last post by:
Here is how you create a complex data report that involves parent and child commands and you can update information at runtime. Its pretty straight forward to work with simple queries; however,...
1
by: pupilstuff | last post by:
hi guys i wan to make dyanmic crystal report according to values which i checked from check box thats all i did 1. I made data set having data table name "Customer" 2 i put four columm id,name...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.