Running Reports With Criteria
Oct 25, 2004How do I run a report based on a table, but with criteria? For example, I have a few check boxes on my table and I want to run a report of all the people who have the boxes checked. Thank you!
View RepliesHow do I run a report based on a table, but with criteria? For example, I have a few check boxes on my table and I want to run a report of all the people who have the boxes checked. Thank you!
View RepliesI need to run a query using a list of unique values. I open a new query in design view, pick my table that I want to use, pick the field, but then in Criteria, I need to use a list of values. The list is 62 values long. Any help here would be greatly appreciated. I hope I am explaining myself thoroughly.
Thanks,
a_brooks
I have determined the solution to my problem lies outside of normal SQL queries and I need to create a UDF.
Here is the problem. I need to create a running total based on the sum of two fields [PTS_ISSUED] & [PTS_REDUCED] with one restriction. The total can never be less than 0. If it is less than zero, the totals reset with [PTS_ISSUED] as the new starting point.
I've attached an excel spreadsheet. Column"C" contains the formula logic I am trying to replicate into access.
I will be honest, writing the UDF is beyond my current knowledge but once I see it I am able to understand it and implement it.
I believe the solution needs to store the running total into a variable, make the necessary comparisons and determine if its okay to add the [PTS_ISSUED and [PTS_REDUCED] to the stored total of the previous calculations then advance. I just have no clue in how to go about writing it.
This calculation needs to be presented in Access because the results will drive several other functions within the database.
I have a query I am trying to build currently which creates a running total based on set criteria. I essentially have three columns (All times are in minutes). The visit ID, the duration of a visit and the time difference between the current and previous visit. e.g.
ID Duration Difference
1 30 0
2 45 10
3 15 20
4 60 10
5 15 10
What I would like to achieve is the following:
ID Duration Difference running total
1 30 0 30
2 45 10 85
3 15 20 15
4 60 10 85
5 15 10 110
So a line will have the calculation of the current time + the difference between the current and previous visit if the difference is below 20. I have the following:
Code:
Public Function Cont20(MyVal As Long, MyDif As Long) As Long
Static OldValue As Long
Dim NewValue As Long
If MyDif >= 20 Then
NewValue = MyVal
OldValue = 0
[Code]....
Which I put as Cont20([Duration],[Difference])
The problem seems to be on the return aspect, its not calculating correctly. I had the formula in Excel which worked great, but this is proving troublesome. As a note the Excel formula was such that it would add the previous running total and then add the current duration and current diff. e.g. In cell A7 the formula would be A6+B7+C7 and so on.
Hello All,
I do hope somebody can help this newbie :)
Please except apologies if I sound a bit ignorant with this but I'm complete novice with Access...
Basically I have a table with the fields Name - Date - Location I need to extract info from the table based on the location field.
i.e. return Name if a specified location exists and another specified location does not. This was real pain in itself and in the end I had to run two seperate queries which returned NAmes where each of the chosen locations exist. I've then created an additional query which compares the two sub-queries and iliminates Names that appear in sub query 2.
I do hope this make's sense I'm starting to confuse myself.....
Anyway, my problem is with the date field... I have to specify a date in order to get the correct info as the results may change on a daily basis... i.e. somebody may use both locations one day, but just the one location the next. However the eventual report which I need to generate is based on criteria over the previous 7 days, although if I use this criteria in my query in completely messes up the results.
So, what I was hoping that I could do is somehow automate my query to run 7 times (once for each of the previous 7 days) and then to combine the results of the 7 queries into a single query or report...
Failing that, could anybody think of any simple way of achieving this... or will be a case of having settle for a seperate report for each day?
Any help would be hugely appreciated... once again apologies for the explaination... It porobably makes no sense at all.
Regards,
Andrew
I need some help with a report that has running totals of both positive and negative values. The report needs to have a subtotal of the positive values only, then the negative values only. The negative and positive values appear all in the same list. The running sum property over group/over all only adds all the values together which is of no use. Is there any easy way to do this?
Example Report snippet:
(Ignore all the dots - its the only way I could get everything to line up)
# Code...Cleaner...Current..+1Week
1..12....J. Smith........$12.20.....$4.50
2..15....R. Anderson...$10.00.....$2.30
3..18.....E. Jones.....-$14.00.....$1.50
4..19....A. Rob...........$3.50....-$2.50
TOTALS: (+)............$25.70.....$8.30
.............(-)...........($14.00)...($2.50)
-------------------------------------
Balance.................$11.70.....$5.80
what I think is a running total for each day. I have a form that collects data several times in the day. I want a report to show a total for each day and subtotals for each column and grand totals. I can add the dates and used a running total to the report but the report will show all the entries made for the day not a single total for the day. (I hope I said the correctly.) This needs to be done for all columns. I'm not sure what I'm doing wrong. I've attached what I have so far.
View 2 Replies View RelatedI have a report about bowlers & series. I am attempting to do a running sum on each bowler's series & games bowled each week, so I can get a new composite average each week.The data looks good until the 2nd to last row of data. The running sum on series & games bowled for every bowler is blank even though I have a series that week for all bowlers. And the averages for that week show a 0. The very last row of data for all bowlers is fine and correct.
View 3 Replies View RelatedI have a form which lets the user enter a contract ID and then a combo box that has a list of reports which run against whichever ID is entered.
What I want to know if I put the ID's in a table if theres a way to allow the user to select multiple ID's in one go and run the report against them the range rather than 1 at time?
I'm thinking about utilising the check/tick boxes would this be possible? or another way?
I'm using 2003 and have some VBA ability.
I have a query that uses the input from a form as criteria, which is then used in a report. The form input is a drop down based on another table. This is a sales pipeline report, and the list is a list of sales people. The report works perfect for all sales people except one. When I run it for the one, I get the following error:
"This expression is is typed incorrectly, or it is too complex to be evaluated. For example, a numeric expression may contain too many complicated elements. Try simplifying the expression by assigning parts of the expression to variables".
I DO NOT get the same error when running the query by itself - so assuming there is something in the report causing this. I do have some sum formulas in the report.
Again, no other salespersons selected cause this error -- so I am assuming there is something in the dataset for this person that is causing the error.
I am trying to run a query and display the results in a report (the report side of it is childs play and not a problem). The problem I am having is that I have a search form which should allow the user to search any one of 6 fields (text boxes) or a combination of each.
If the user enters something into a field then that search criteria must match. I wanted to have it so if all fields are left blank then it will show all entries in the database (but it isn't, it shows a blank report). I also wanted it to allow partial completion of boxes.
So for instance if I have 5 customers (Jones, Jonson, Jonus, jimjonkins, Janis) and I type "Jon" into the name field then I would like it to show the first 4 records as they all contain "jon" somewhere in their name but its not, its only allowing exact matches.
I currently have '[forms]![Search_Customer]![Search_Name]'.
I am using a form with command buttons on it to set the criteria in my query to run the report.
Example : cmdQ1 'Command Button
PHP Code:
'1st Quarterly Report.
BeginDate = DateSerial(Year(Date), Int((Month(Date) - 1) / 3) * 3 + 1, 1)
EndDate = DateSerial(Year(Date), Int((Month(Date) - 1) / 3) * 3 + 4, 0)
I managed to get this far but need to continue on with 2,3, and 4th quarters.
Is there such a calculation in REPORT wherein I can have the Running Difference of several numbers?
Example is several Kilometer reading of a vehicle:
18716
18731
18742
difference of red color numbers: 15
difference of 2nd red color number and blue color numbers: 11
total: 26
I don't even know if my calculation is correct ...
I have a report that is created from the following query (qryTotalProjectHours). What I am trying to do is get the total hours spent on Tasks within a given time period.
Code:
SELECT TasksEntries.Project, TasksEntries.Task, Sum(TimeTracker.WorkHours) AS TotalHours
FROM TasksEntries INNER JOIN TimeTracker
ON (TasksEntries.EmployeeId = TimeTracker.EmployeeId) AND (TasksEntries.TaskID = TimeTracker.TaskId)
GROUP BY TasksEntries.Project, TasksEntries.Task;
I accept the start and end dates in a form and pass it like shown below. WorkDate is a column in the TimeTracker table and is not present in any other table.
Code:
strWhere = "WorkDate BETWEEN #" & txtMgrRptStartDate & "# AND #" & txtMgrRptEndDate & "#"
DoCmd.OpenReport "rptTotalProjectHours", acViewPreview, "qryTotalProjectHours", strWhere, acWindowNormal
When the report is invoked, I get a box where it says
"Enter parameter value" for Workdate..
Is there anyway I can get rid of the prompt? I never thought you needed the column name in the SELECT statement to be able to run this.I should add the I tried the query with the WorkDate hardcoded in there and it worked fine and returned the correct results
I remember reading a tut on how to count records using Running totals in a report - but I cannot remember where I read it. It went something like this.
In the section that you want to count, add a field with record source '=1' and make it a running total for the group.
In the header (one level up from where the running total resides) add a field with record source =Max(RunningTotalField)
Although the 'intellisense' sees my 'RunningTotalField' when I create the above mentioned formula, when I run the report, its asking me to input the value for the 'RunningTotalField'?
Have I confused some concepts or am I on the right track?
I am using Access 2003 and trying to create a report that has a running balance of payments into an account. There are also payments out of the account which reduce the balance.
When I add the other columns into the expression for the running total the result shows in the report as "0".
The expression I am using is: =([Escrow Pmt Amount]-[Ins Pmt Amount])
I have this expression in the "Detail" section of the report with the "Running Total" toggled to "Accross Group".
How can I subtract the values in the other columns (Outgoing Payments) from the balance and continue the running total.
The list of payments within the report are date driven and grouped by an account number.
My database is slowly coming together. For the final part of this phase i would like to create a shortcut on each users desktop which runs a summary report of information within my database.
I have criteria set so upon opening the report the user is asked for which address they wish to see information from which works great. But I do not want users to have access to the database, I just want them to be able to click a shortcut, be asked what address they are looking for and for the report to ping up in a 'Print Preview' type layout so information can be seen and displayed but not altered. All users have the access program.
i have a table with health facilities (A,B,C,D) . each health facility has data from several months (Jan, Feb, Mar etc). the table has 2 fields (New Patients) and (Cumulative Patients) . Cumulative Patients is a total of New Patients for current month plus the total patients for the previous month. In the Facility Footer of the report if i create text boxes with data =Sum([New Patients]) and =([Cumulative Patients]) works well.
However in the Report Footer =Sum([New Patients]) works but =Sum([Cumulative Patients]) totals everything. if i try =([Cumulative Patients]).
I have a database and one of the functions is to track the purchase of fuel. Part of purchasing fuel is registering what the current odometer reads. My query gets the Vehicle ID, Date of Transaction and Odometer reading. I want to show a report that shows how many miles the vehicle is has traveled for a certain amount of time. If it's for 2013 then I'll put the criteria for 2014 in the date. This will give me a list of all vehicles and their odometer readings. I then sort the date by ascending.
In the report I group on vehicle ID and then I want to show all their transactions and add up how many miles were driven.
Vehicle 1
1/2/201
1/5/2013
1/15/2013
ETC...
Total Miles Driven in 2014: XXXXXX
I have DB in access 2007. I have a report that is uses a select query to generate the information for the report. It has been working great, But however lately like maybe with in the last month, it has been causeing Access 2007 to crash. I am having the same issue with another DB that uses the same information but that information is imported in. both Databases have worked great up until two months ago. Microsoft states that it is because of the program. I have tried to repair the DB by using the Repair option. I am confused as to why this would be happening. I can create a new report and it seems to work. but I do not want to change all the DB on everyone's computer just for this reason. I also have two buttons on my report that utilize macros to close or print the report.
View 6 Replies View RelatedCan anyone tell me how to get a running balance on a report. I know how to create a running total, by setting the "running sum" property of a text box to "Over all".
I can't however see how I can adapt this to give a running balance (as in a bank statement for example). Attempts to do so end up in failure!!
Many thanks in advance.
Peter
This is in regards to my same database file posted in my last thread. Basicly it's a work order database. Each task has an employee and the quality of work they did. 1=Bad, 5=Great...so it's from 1-5. I need to create a report of all the tasks which had a quality score of 3 or below for the previous month. I'm good with SQL, but I can't figure out how these Access reports work.
I want my client to be able to double click on the report and have it generate. It would be nice to have it save to a PDF or Word doc, but that would be a plus. Right now I just need to know how to generate reports based on a criteria. I searched the web for 2 hours and could not find anything about this.
Thanks
ACCESS 2010, I have a from and to date in a query. How do I get these two dates to show in the report header ?
View 1 Replies View RelatedI have following table, forms and reports in my access database:
Tables:
1- maintbl
Query:
1- mainquery based on maintbl
Forms:
1- Input or mainform based on mainquery
2- unbound form: to Filter report
Report:
1-mainreport based on mainquery
Objective:
I want to filter report on followings:
Name(Text)
Month(Text)
Year (Number)
I have 3 combo boxes on ubound form and want to filter report based on three above mentioned criterias.
creating a DLookup expression for an unbound control on a report. This report displays data collected from the users from a table called tblaudit completed. This table contains (among others) three fields labeled below
Brand
Form
Area Changed
I also have another reference table labeled refevalareas. The fields in this table are as follows
BrandName
FormName
AreaName
PointValue
I would like to create an unbound control on my report that "prints" the point value depending on the Brand, Form, and Area displayed for each record. Though the field names are different the data collected and displayed in each table is consistent. I haven't worked much with Lookups and the logic is challenging for me to grasp but I think I have the basic idea which is shown below..
DLookup( refevalareas.[PointValue], refevalareas, ("[BrandName] = '" & Reports!rptqryauditcompleted![Brand] = "'") & ("[FormName] = '" & Reports!rptqryauditcompleted![Form] = "'") & ("[AreaName] = '" & Reports!rptqryauditcompleted![Area] = "'")
I am having trouble filtering my report. My goal is to filter the report by:
1) [DateChanged] by user entry on a form (txtFrom and txtTo)
2)[Deliverable] by selection of a list box on form
My error is in the last line when i open the report. It only lets me filter using either option 1 or 2. When I include the "And", it gives me the error "Type Mismatch". I know its a syntax error.
My code is below
'''''''''''''''''''''''''''''''''''''''''''''''''' '''
Dim Deliverable As String
Dim DateChanged As String
Dim VarItm As Variant
For Each VarItm In List2.ItemsSelected
Deliverable = Deliverable & "[ID] = " & List2.Column(0, VarItm) & " OR "
[Code] .....