Reports :: Filter Multiple Fields In A Report Using Comboboxes In A Form?
Jul 24, 2015
I have a report based on a query that I put inside a form. What I want to do is create 4 comboboxes from which users can choose options that will filter the report without leaving the form or opening the report in a separate window. Also, I want to make the filters dependent on each other, meaning if a select option A on combobox 1, the options i will select on combobox 2 will only be based on the earlier filter on combobox 1 ...
So far I'm able to do at least 2 of the comboboxes to filter the report, but they aren't based on which one was used to filter the report first. So if i filter the records by choosing option A on combobox 1, combobox 2 will still filter every record.
here's my 2 codes so far:
Private Sub cboLocation_AfterUpdate()
On Error GoTo Proc_Error
If IsNull(Me.cboLocation) Then
Me.qrySalesByLocation.Report.Filter = ""
Me.qrySalesByLocation.Report.FilterOn = False
Me.qrySalesByLocation.Report.Requery
[code]....
the other 2 comboboxes, I can't apply the same code cause the enter parameter dialog keeps popping out.
View Replies
ADVERTISEMENT
Aug 17, 2015
I am quite new to Access and have been working with a sample DB from Microsoft. I have been looking for some ways to filter a report based on the values in some comboboxes, and have followed the instructions on a website (can't post link yet).
I also looked at this file (**can't post link yet**) and it seems like everything works fine here. So I started a new DB with my own table, and tried to do the same thing as in this file.
Everything works fine.
But when I try all these steps in my own DB (the sample DB from Microsoft), it doesn't work.
When I filter by "Status" (f.ex: "In Progress" or "Not Started"), it seems to work fine.
However, when I filter by "Assigned To", I get the following error message: "Data Type Mismatch in criteria expression". So I googled this error message , but this field has nothing to do with any date formatting.
It gets even stranger when I try to filter by "Project":
Then a new pop up appears and asks me to enter the "Project".
No matter what I enter, the report turns blank
View 14 Replies
View Related
Dec 4, 2006
Hi,
I have a form with a subform on it. Also contained on the form are 5 comboboxes that are listing the entries in each table.
What i would like to be able to do it select an entry in any of the comboboxes and that will in turn filter the subform on the selections made whilst also filtering the remainder comboboxes based on a selection made.
I can get it to work by filtering one at a time with this code bound to each combobox:
Private Sub cmbAisle_AfterUpdate()
Me.qryAllData_subform.Form.Filter = "[Aisle]='" & Me.[cmbAisle] & "'"
Me.qryAllData_subform.Form.FilterOn = True
End Sub
But each time i select an entry in another combobox it re-filters on that selection.
Any Help would be much appreciated.
Dazz
View 1 Replies
View Related
Jul 19, 2015
I have a frmOpenReport which has 7 combo boxes linked to 7 Query's.
I have found code to add selected values from one combo box from a button 'Open Report' to a report but struggling to find how to select selected values from all comboboxs and add to a report.
My code so far.
Option Compare Database
Option Explicit
Private Sub cmdOpenReport_Click()
On Error GoTo Err_cmdOpenReport_Click
Dim strWhere As String
Dim ctl As Control
Dim varItem As Variant
'make sure a selection has been made
If Me.HLO.ItemsSelected.Count = 0 Then
[Code] ....
View 6 Replies
View Related
Jul 30, 2013
My problem I am having is that in my database you can click around to different customers info on forms and from there you can click on a button to get to another form that lists all of the customers vehicles. From there I have a billing report that I created and I am trying to filter the report to get what I want on there.
I have been searching around and have found codes to filter reports so that right now I have it when I click on Billing Report it filters by the customers form i am on. But now where i am having some issues is that I am also looking to filter by a yes/no field so that anything clicked yes for that customer will be filtered to show on this report.
View 2 Replies
View Related
Jul 24, 2013
I am using a form to filter information so that I can open a report. The report displays information pertaining job costs. Each month the company I work for records their labor, costs, and travel in a form with a year to date amount. Right now, I am having a problem opening up a report for one specific job and a specific month. So what I want the dialogue box to do is to pick from a list of jobs then pick from a list of months, click a button that prompts a preview of the report.
View 14 Replies
View Related
Oct 24, 2013
I have a report based on a query, the report loads filter based on dates input to the query from Form1 when report loads. I want to filter this report further from a listbox on form2, but I want the listbox rowsource to populate based on a field in the loaded report. Is this possible?
View 2 Replies
View Related
Jul 21, 2015
Working on a report that displays multiple pie charts. Each chart is based on a different query. I cannot pull a single query for all charts due to the criteria for each conflicting with each other. Each query is filtered by Fiscal Year based on what I input into my Fiscal Year Filter form. The command button on the FY Filter Form opens the report, set TempVar to the FY field (the criteria for each query), and closed the FY Filter Form. This works as I want it to.
The problem: I have additional fields I want to show up on the form such as number of completed students (WINGED). This number is based on yet another query where all completed students are counted [WingedCount]. I have tried to write an expression to an unbound field that points at this [WingedCount] field but it does not work. Then, I changed the report's source as the query with the [WingedCount] field. This does work, however this is where I run into an issue
I open my FY Filter Form and type in my criteria and select the open command button. However, now I am asked for the criteria again for each chart on the report.
I need a way to input the criteria only once and have all charts populate as well as my count field.
I have attached a jpeg of my current report and will upload jpegs of the needed output following this post.
View 6 Replies
View Related
Oct 2, 2013
I have been an MS Excel man all along my career and I am a novice in MS Access.I have created a table, [Initial Customer Approval] which records data from a Form, [Initial Customer Approval]. Once the data is entered in the Form, I need to do some calculations based on the data entered in some of the fields in the form.I created 6 different queries for the six possible values in those fields. now for each of those queries I created respective reports.I placed a Print command button in the Form.
1. When I press the Print button it should open the report for the current record in the Form. (Currently It Opens all the reports simulatneously, with only one relevant report containing the current record; other opened reports being blank.)
2. If user presses the Print button before pressing Save button then system should prompt user.
Here is the code (Please note [reference number] is the unique ID generated for each record entered in the tabe through form):
Private bSaveClicked As Boolean
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Not bSaveClicked Then
MsgBox "You are trying to navigate away from the active record. Please either save your changes, or press ESC to cancel your changes.", vbOKOnly + vbInformation
Cancel = True
[code]...
View 5 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 26, 2014
I'm trying to use a command button in a form to filter and open a report. I am able to get it to open the report, but I cannot get it to filter the report based on a combobox in the form. I've tried every combination of code I could think of and find. Here is what I currently have:
Code:
Private Sub FilterReport_Click()
DoCmd.OpenReport "Report", acViewReport, "First Name='" & Me.FName & "'"
End Sub
Code:
Option Compare Database
Private Sub Report_Open(Cancel As Integer)
Me.RecordSource = Me.FName
End Sub
"FilterReport" = Form Button
"Report" = Report
"First Name" = Report Field
"FName" = Form Combo Box
View 14 Replies
View Related
May 11, 2015
I have a report , which i print every month and it consist of of more than 500 pages. This report is based on a Query called L_Inv2. i want to filter and loop this report based on the filed AccountReference with in the query. And save as PDF for individual accounts.
i have also created another query based on the L_Inv2, Called L_Inv4 which only got the record of account numbers as a AccountReference
i am trying to use below code but some how this is not working.
Code:
Private Sub Command43_Click()
Dim db As DAO.Database
Dim rs As DAO.Recordset
[Code]....
View 6 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
Jun 27, 2014
I have a report based on a query.There is a field in my personnel table and the query: [Field] with values from my lookup table and has three choices:
1-Inspections
2-Administrative
3-Safety..
I have a report and would like to filter based on [Field].I can filter by putting [Field]=Inspection on the Filter On Load, then typing 1 into the parameter box. And it works.I cannot however choose more than one of the three choices and I have to type the number in. Fine for me but it won't be for other users.it is used for more than one report. I would also like to avoid having seperate queries for all these reports.In other words, I would like to filter the report, not the query.
View 14 Replies
View Related
Jun 7, 2013
I have a report containing all the fields from my "main table". I want to create buttons on a from that will filter information from the report. For instance, I have a field titled "Priority". I want to create a button that will filter the report to only show records with a "Level 1" priority. Is there anyway I can do this using VBA?
View 3 Replies
View Related
Jan 18, 2015
I 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.
View 1 Replies
View Related
Aug 17, 2015
I made a report that show a list of data where there is a date. It sorts the report by year then by month.I collects the information about the date from a field in a table where the whole date is inserted (example28.12.2014. (date/month/year)).What I want is to make a combobox or a listbox where you would chose a year you want it to show you the report for and a button that would open the report.So to make it clear in a form you would have a combobox where years would be displayed (and i would like the combobox to somehow know what years are inserted in the table), you select the year and click on the button that would open the report for that year.
The report name is "rptClients". The table from where the data for report is taken is "tblCustomers" and the field where the date is in the table is called "DateOfUse".Also in the report the date is in a field called "DateOfUse" also.
View 1 Replies
View Related
Jun 24, 2014
I am trying to filter a subreport on open.
In my report I have a field called "Packages" and my subreport consists of a table, one of the columns is "Packages" so I want to use the value that I have in "Packages" to filter for only those items in the sub report.
Is this possible?
View 14 Replies
View Related
Apr 30, 2015
I have a report filter that filters the reports by month and year:
Code:
DoCmd.OpenReport "AttWholeCity", acPreview, , " Month = '" & txtCourseDateMonth & "' AND Year = '" & txtCourseDateYear & "'"
I want the code to also show these two columns where there are null/blank values aswell, for example if I filter by apr 2015 i want the report to show these columns as well as blank columns is this possible
View 9 Replies
View Related
Oct 3, 2013
I'm using the following code to filter a report by using a multi-select box.
Code:
Private Sub cmdOpenReport_Click()
On Error GoTo Err_cmdOpenReport_Click
Dim strWhere As String
Dim ctl As Control
Dim varItem As Variant
[code]....
I have a report that contains a subreport. The report is simply an image of a word document. The subreport will contain the actual data.When I open the subreport, the IN query works perfectly. When I open the main report, I only get the first record listed in the IN query. I have the master/child links set properly.
View 14 Replies
View Related
Feb 24, 2014
I have a report on this report there is a Destination City field and a Current City field, loaded from a table. I have a command button that loads a form to filter on the destination city, I have another command button that loads a form to filter on the current city location.
What I would like is, when I use the form to filter the destination city, then load the form to filter on current city, I want the listbox on the form for the current city to only list cities that are associated with that destination. Both form listboxes have the rowsource from the same table, just different fields. Is this possible?
View 7 Replies
View Related
Aug 21, 2013
I have a report, rptAllCSCS which is based on a query qryCSCS2...
One of the fields in qryCSCS2 is Status and each record is either "Current" or "Not Current"...
My report is being viewed via a navigation form, so one of the tabs says CSCS and when clicked the user can see the report...
I have added a button in the report header which when clicked opens the report in print preview so the user can print the report. (Done with a macro in the On Click of the button.)
I would like to add a combo box cmbStatus which has the values "Current" and "All" in the report header. (Current will show only when the Status field = Current and All shows all records so Current and Not Current together). This will act as a filter for the user to see the corresponding records and they can then press the print button or just view on screen.
I haven't worked with filters before except when you specify the criteria in the query and point it to a control on a form which then opens the report... As this report is already open I'm having trouble, as well as specifying the "path" when something is in a navigation form being a bit tricky...
View 6 Replies
View Related
Nov 14, 2013
I have a report with 2 option groups, I cannot get both of them to filter the data simataneously, they will each inititally filter the data, but when the opposite group it clicked, the previous filter data does not remain filtered. I have posted the code for the two option groups, I know I'm doing something wrong.
First option group code:
Private Sub Frame43_Click()
Select Case Me.Frame43.VALUE
Case 1
Me.Filter = "allowable_weight Like '263000'"
Me.FilterOn = True
[Code] .....
View 5 Replies
View Related
May 26, 2015
I have a database which have tbl1 with field admission year with data like august/2007, august/2008. i have entered all data with form1. My problem is that i want filter report. user click a button so a form opened and than he entered data in a text box like august/2007 when he click on show report button only those pages which have august/2007 text will display in report. second time when user change text like august/2008 in text box report also show changes.
View 5 Replies
View Related
May 27, 2015
The data the query pulls is employee name, course ID, course name and course completed date. I have added criteria in the query that asks for the Course ID to filter on a given course and a dynamic field in the query AnnualReqDate: DateAdd("d",+365,[TrainingCourseCompleted]). What this returns is a list of employees that have completed course X the date they completed and the date (12 months) when the course is due. This works great, have created a report that reflects this very well.
The issue comes in when I try to add the ability to filter by date range on the AnnualReqDate dynamic field. the AnnualReqDate dynamic field does not exist until the query is run the Between [Start Date] And [End Date] criteria add to the AnnualReqDate dynamic field wont work.The query fires off but returns zero records.
View 14 Replies
View Related
Aug 29, 2013
I have a report [Report1] that gets its data from a query [Query1]. On [Report1] there is an unbound text box [EnterEndDate] that I want to use as a filter for the report criteria, and have it filter the report to show every report row with the value in the [EndDate] field greater than what the user entered in [EnterEndDate].
There is no need to save the value used in [EnterEndDate]. It will be entered after the report is run and changed on demand while the report is open for the user to see different date ranges.
View 2 Replies
View Related