Reports :: Filtering A Report Based On Chosen Criteria In The Form
Mar 12, 2015
I have a report with a table as the row source. I have command buttons that opens different forms and allows the user to choose criteria, the form then filters the report based on the chosen criteria in the form, but if I use the destination city form to filter the report by destination city, then filter the report using a different form, the destination city filter is lost, is there a way to filter the report with a form by say destination city, then further filter that dataset with another form for say location city.
View Replies
ADVERTISEMENT
Aug 5, 2015
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] .....
View 3 Replies
View Related
May 28, 2014
I have a table that consist of pricing for different types of products:
Table name: Costs
ID TYPE EastNew EastRenew WestNew WestRenew
1 500 4100 1000 4400 900
2 501 4100 1000 4400 900
3 600 3400 900 4600 1200
4 700 3700 1300 4900 3300
I have a form that consist of many fields that the user needs to manually input data. 3 fields on that form are the criteria i need to determine which pricing to use back on the table. The first field, which name is LTYPE, is a combobox that the user needs to choose as its type (i.e 500,501,600,700). The second field, which name is EastCoast, is a checkbox (Yes/No) that tells me if it's East Coast (East = yes and West = No). The third field, which name is NewRenewal, is a combobox that the user chooses NEW or Renewal).
Example 1, if the user chooses type 501, checkbox is YES for East, Product is NEW. Then the pricing is $4,100
Example 2, if the user chooses type 700, checkbox is unchecked for NO (which is West), Product is Renewal. Then pricing is $3,300
I would like the unbound field to auto determine the pricing based on the 3 criterias chosen. I read around the forums that Dlookup would be the function for this, however, i tried many times but it did not work.
View 6 Replies
View Related
May 7, 2015
I have a form with 3 combo boxes that filter another form/report. The first combo (cboByCategory) contains options from 2 different fields within the same table. Before I added this add'l piece of code, all 3 combos worked fine. I am not getting error messages, it just does not filter on the other 2 combo boxes - cboDiv and cboGender.
Code:
Private Sub cmdModifyRecords_Click()
On Error GoTo Err_cmdModifyRecords_Click
Dim stDocName As String
Dim strFilter As String
Dim stLinkCriteria As String
stDocName = "Modify_OpenItems"
[Code] .....
View 5 Replies
View Related
Jul 27, 2015
I am in the learning phase for MS Access reports. I have a datasheet which contains the employee daily activities.I need a report when either or both criteria is selected. For ex..criteria1 is Start date and End Date and criteria2 is Employee Name.Output of the report should be based on the selection of the criteria ,as I said either or both.
View 3 Replies
View Related
Jul 20, 2006
I am making a Customer Contacts database. The people in this database are organized into 30 groups.
I have one main form, and 30 queries to filter the records displayed on the form
I made buttons on a form representing the different groups of contacts to view, and when you click on one of those buttons, the main form opens with the record source as the query of the group you clicked on.
Here is my coding for one of the buttons
DoCmd.OpenForm "MainForm"
Forms![MainForm]![HomeAddress].Form.RecordSource = "Company Work"
Also on the main form, I have a button to open a report that displays address labels of all the people in the database
How do i code that button, so that the records displayed in that report will be the same as those records displayed on the form? How do i filter the records in the report so they will be the same as in the form?
View 1 Replies
View Related
Nov 10, 2014
I have a form with a command button that runs a report. I have been asked to modify things and if the data in the text box is "A", run report "A". If the data is "B", run report "B" and so on.
View 3 Replies
View Related
Oct 22, 2013
I created a database to record time logged per workorder for each employee on my job. Each time log has a specific "Trade" attached to it along with a number of hours the employee spent on that workorder. I've created a report to display how much time the selected employee spent on each workorder (within a date range) and now I want to see what percentage of their time was spent on a particular "Trade" (for instance, during September Employee "name" spent "percentage" of their time on Electric, "percentage" on HVAC, "percentage" on Plumbing...[and so on])
I have trades listed in the table and in the time log, the form writes to the trades area of the table (probably very elementary for this discussion) and the report lists the name and grand totals with percentage of total time on each workorder, but does not list any trade information.
How can I add this into my report, preferably at the end (Report Footer?)
View 4 Replies
View Related
Mar 20, 2013
I have a report that gets its data from a query. I need the query to run before the report based on criteria based from two combo boxes on a form.
View 3 Replies
View Related
Jul 22, 2014
I have a modal form which has a single record which is then linked to a sub-form on the same modal form. This all works fine and shows the relevant record and sub records but I want the modal form main record to change dependant on the record selected in the subform (which is basically order item history.
I found some code on another site which seemed to work for others but for me I am getting Run-time error 2465 and it doesn't like my reference to 'Me' - is this because it is a modal form?The code I am using is:
Public Function GotoRecord(RecordID As Long)
Dim rst As DAO.Recordset
Dim strCriteria As String
Set rst = Me.RecordsetClone
strCriteria = "ID = " & RecordID
rst.FindFirst strCriteria
If rst.NoMatch = False Then
Me.Bookmark = rst.Bookmark
[code]....
View 1 Replies
View Related
Nov 16, 2014
The aim of what I am doing is to create a monthly statement to give to our intermediaries that shows the commission they will receive each month for the deals they have referred. I have managed to create this report, HOWEVER I can't figure out how to filter out which month I need, so I a report for Jan, Feb Mar etc... The idea is that at the end of each month I need to run the report so only the latest month shows...
View 3 Replies
View Related
Nov 17, 2006
Hi,
I have the following code which i found on another thread on this forum (thanks to original author) which is attached to the On Click of a button which prints the report corresponding to the details displayed in the form.
Dim strCriterion As String
Dim strMsg As String, strTitle As String
Dim intStyle As Integer
If IsNull(Me![ReferenceNumber]) Then
strMsg = "You cannot print a Blank Form!!."
strTitle = "Print Error"
intStyle = vbOKOnly
MsgBox strMsg, intStyle, strTitle
Exit Sub
End If
If Me.Dirty Then
Me.Dirty = False
End If
strCriterion = "[ReferenceNumber]=" & Me![ReferenceNumber]
DoCmd.OpenReport "DoC Certificate", acViewNormal, , strCriterion
This works fine, however, i need to be able to select the report based on more than 1 criteria. For example, the Reference Number can be repeated but is distinguishable from each other by an Issue Number i.e. ReferenceNumber = 93, Issue 1 or 2 etc. At present when i run the above it prints all versions of, in this case, reference number 93, which given that each report is only a single page isn't a show-stopper but it would be nice to have it working as i would like.
I have tried adding to the strCriterion line such as strCriterion = "[ReferenceNumber]=" & Me![ReferenceNumber] and "[IssueNumber]=" & Me![IssueNumber] but no joy. I have tried bracketing the whole line and variations thereof, again no joy.
Can anybody tell if what i am attempting to do is possible and if so how do i go about it?
I have tried the above coding using MasterID which is the Autonumber PK but it produces an "Enter Parameter Value" box for MasterID. Obvioulsy if i can get it to work for the Autonumber then my problem goes away but i can't seem to figure out why it works for Reference Number (Number) and not MasterId (Autonumber)?
Regards
Alan
View 5 Replies
View Related
May 28, 2013
report i'm trying to preview. I have a form which will display a person's training record and on that form i'd like to have a button which, when activated will show the record as a report in Print Preview. However, i'd like to just preview the record i'm looking at and not all of that person's records.
View 4 Replies
View Related
Feb 9, 2015
I do not have the privileges to write code, but can use macros and Expression builder. I have written a bunch of queries and made reports for each of them. What I want to do is to be able to choose from the list of reports and view the chosen one. If that cannot be done without code, then to choose from a list of queries and then view the report made from the query. The user needs to be able to choose.
View 2 Replies
View Related
Oct 20, 2014
I have a form where users can enter the beginning and ending dates into text boxes. They could also do it for the number of the week (1 to 52) or a single text box for the quarter.
I set up VBA code where, if you click on a button, it will clear out the data from the other two options before a query is run based on the parameters in those text boxes. Here's a sample piece of code.
Code:
Private Sub btn_UseDates_Click()
Dim lngGreen As Long, lngWhite As Long
lngGreen = RGB(0, 255, 0)
lngWhite = RGB(255, 255, 255)
Me!txtDateFrom.BackColor = lngGreen
Me!txtDateTo.BackColor = lngGreen
Me!txtWeekFrom.BackColor = lngWhite
Me!txtWeekTo.BackColor = lngWhite
Me!txtQuarter.BackColor = lngWhite
Me!txtWeekFrom = ""
Me!txtWeekTo = ""
Me!txtQuarter = ""
End Sub
I've tried setting those txt boxes to Null and I've tried both "" and " ", but to no avail. The query will work if the three types of ranges (date, week, or quarter) are on OR lines, but not on the same line.
View 5 Replies
View Related
Aug 8, 2014
I have a database (Access 2007) that handles a large number of consultants. Each consultant has a number of skills, has worked in a number of countries, and speak several languages. As contracts come in, I wish to generate a report based on the skill set, language and country/countries that best suits the contract; thereby identifying a group of most suitable consultants. I have designed a report with three sub reports for skills, languages and countries. Each sub report is linked to the main report through Link Master/Child fields using the ConsultantID. That's all fine; I get a report showing all consultants listing all their qualities.
Now, I want to be able to filter the sub reports on the three aspects: Skills; Countries; and Languages.
In the past, for other applications, and with the unfiltered form in preview I have used a popup form with unbound Combo Boxes to generate a string to use in the reports filter. I think I got that technique from Allen Browne, and it has really served me well.
Now, however, I can't use this technique since I can't set the filter for the sub reports. I thought that I might be able to use the Link Master Field with text boxes on the main report, but haven't managed to figure that out.
View 14 Replies
View Related
Jun 9, 2014
I work in psychological testing and I have created a database to store some data for our patients' test scores. I have a main form with demographics and then 5 buttons on the main form that open into 5 other forms (one form for each test). I also have created a button on the main form to run a Report; however, I would like to filter the report to only show the current record (e.g., Patient ID #1 only).
(Can this be done?) How should I go about filtering the report to show only the open record? Expression is preferred - I'm not very good with code.
I'm also assuming that since each form is linked by the primary key of Patient ID, I should be able to see all data from each form (main + 5 others) in the report for that specified Patient ID... (?)
View 4 Replies
View Related
Jun 26, 2013
I am trying to print a report based on the filtered results of a form where the data record source is generated from a query. What I have is five unbound comboboxes on a form that filter the results of the query on a subform which works fine in whichever combination I set, I then want the report to print out the results of the filter and the filter combination that I used - basically exactly as it appears on the form (I have used the same query / subform in the report with text boxes to show the filters used on the form). My VBA skills are quite limited (but improving!) and I have trawled the web trying different code examples but can't seem to get it nailed. Current filter code follows;
Code:
Option Compare Database
Option Explicit
Private Sub PrntConfigReport_Click()
[Code].....
View 3 Replies
View Related
Oct 9, 2014
I have created a form with an option group with 4 options (date, line, description and observation). Each of these options are to be a sort order for a report that will open after the user selects an option and clicks a button. I am trying to code the button using a select case so that case 1 opens the report sorted by date, case 2 by line, etc. how to write the code for the sorting.
View 6 Replies
View Related
Aug 7, 2013
I am using the Navigation form and I have a tab that has all the sales quotes for a particular salesperson. Because my salespeople like to work with paper I have created sub tabs which contain a report with the same information but filtered based as follows: this Month, this year, and Last year. This report needs to be printable based on the filtered information so I created a print button within the report however when clicked it prints the entire report not the filtered report.
The filter criteria is located in the navigation button, navigation where under the data properties. I have the on click event of the button set to open the report in print preview but I need to know how I filter the where in the macro to read the criteria from the active navigation button property?
View 1 Replies
View Related
Jun 23, 2015
I've restructured my 'application' to have one table and a lot of query/forms. In light of not figuring out the combo box situation I altered the requirements and what I needed thinking I may have an easier go of it, but alas not exactly my experience. I have 5 reports that I want to filter them by week(start of the week). I have a function which can turn any regular date entered to the start day of the week(monday). I thought my best way about this would be to fill a combo box with all the accepted dates through a separate table's column.
Is there a way to pop a dialog box when the user clicks to generate the report that will prompt them to choose a week then run that criteria against the report and only bring back that date?
View 14 Replies
View Related
Mar 13, 2013
My report generates base on 2 date inputs(from textboxes) namely, ProcStartDate & ProcEndDate & a combobox(cmbRptSupplier) to select the supplier:
Code:
Private Sub btnReport_Click()
Dim strDocName, strWHERECondition As String
strWHERECondition = ""
If Me.cmbRptSupplier = "" Or IsNull(Me.cmbRptSupplier) = True Then
[Code].....
When I leave my cmbRptSupplier blank (so that I can leave supplier out of my criteria), & fill in 1/2/2013 for ProcStartDate, 14/3/2013 for ProcEndDate, I get ALL the invoices displayed in return for my report. Even with those before 1/2/2013.
View 10 Replies
View Related
Aug 10, 2014
I've created a report which has 4 subreports linked to it via a ClientID. The problem is it prints 2000 reports for the 2000 different ClientIDs. I want, went the button is pressed, for it to ask what ClientID the users wants to print the report for.
I know how to do this in a query based report via criteria, buthow to get this to work when the reports been directly made from a table.
View 14 Replies
View Related
Aug 15, 2013
I have a main Form "Client" that shows details such as Representatives, phone numbers, status, etc. I also have a main report "CRM" that is a nicer summarized table version of all of my Client form entries.
The "CRM" form will be used by others in my office to see what clients we are contacting, etc. What I want to be able to do is have someone open the CRM form first. If they want to see even more specific info (not everything is included in the report, as that would be too messy), I want them to be able to double click the Client's name on the report and be taking to the corresponding entry on the Client form that shows more details.
Right now my code for the Report which is not working is the following:
Private Sub Client_Name_DblClick()'double click on a client name in the reportDoCmd.OpenForm "Client", acNormal, , "[Client_Name]='" & [Client_Name]'this should open the Client Form to the record of the same client that was double clicked on the reportEnd Sub
View 14 Replies
View Related
Apr 25, 2014
I am trying to generate a report that is based off of a query. The query has a form filter that it needs to filter the data. I keep getting a jet engine error and couple others.
The form has year, start week, and end week on it. I can get the query to work fine. When I try to open the report, Access says it doesn't recognize the " [Forms]![frmUptimeFilter]![StartWeek] " as a valid field name or expression.
View 2 Replies
View Related
Jan 8, 2014
I'm currently working on a database which requires invoicing as a part of it. The invoicing is done based on quarters, and I want the users to be able to use a multiple items form, listing all of their clients, to create the invoices. Each invoice must be created individually so they can be e-mailed to the client, and saved to the clients folder. So I was wondering if it would be possible to create individual invoices for clients using a multiple items form.
View 1 Replies
View Related