Queries :: Filter Records In Combo Box By Form Using In Function

Jun 15, 2013

I want to filter the records in a combo box (cboSupplier) using the In() function.

On the form I have an unbound control called "intFilter". It contains the following string: 23, 58

The SQL statement for the combo box is

Code:
SELECT SupplierID, SupplierName
FROM tblSupplier
ORDER BY SupplierName;

In the criteria for field SupplierId I want to use the In() function so that the only records returned by the combo box are those in "intFilter". I have tried

Code:
In (Forms![frmSupplierReport]![intFilter]

but this does not work.

If I put: In (23, 58) in the criteria it works, but I cannot hard code it because the string in "intFilter" will change on the fly!

How would I achieve this?

View Replies


ADVERTISEMENT

Using A Combo Box From Main Form To Filter In A Function

Aug 26, 2015

=Sum(IIf([Pass or Fail]="Pass" And [Pay Period]="02" And [Location]="Purple",1,0))/IIf(Sum(IIf([Pay Period]="02" And [Location]="Purple",1,0)) = 0, 1, Sum(IIf([Pay Period]="02" And [Location]="Purple",1,0)))

For [Pay Period] ="02" is there a way to make it filter by a combo box from the Mainform? This code is on a Subform the combo box is on a Mainform

Forms![Overview_]![Combo35] <the path for the combo box.

I tried inserting it where the 02 was but it just returns 0 and if I remove the "" it will error the whole thing out. Same if I try to just remove the [Pay Period]="02" and replace it fully it errors out.

View 5 Replies View Related

Problems Using A Combo Box To Filter Records In Another Combo Or A Sub-form

Nov 8, 2004

I have seen a few articles here and there on using a combo box to filter records in a sub-form and to filter records in another combo box, but I am not getting anywhere. I hope someone can belp

Exercise 1

For this exercise, I have the following tables:

tblClients containing client names
tblProjects containing some project details

I want to set up a simple form, so that the user can select a client name from a combo box on the main form which filters the project detail records in the Projects sub-form.
Once the user enters project details, I want this info as well as the selected ClientID to be fed back to tblProjects.


Exercise 2

I have the following tables:

tblProjects as above
tblWorkstream containiig names of workstreams and some other details.

Every project has one or more workstreams

I have a form where users will enter hours worked on each workstream. They will first select Project from a combo box on the main form. This should then filter records to be displayed in the Workstream Combo box, before they can then enter hours.



Please let me know if you need me to explain any part of this better.

Thanks in advance.

ps. I am a novice, so I'm hoping to do the above using default MS stuff, not with complex programming!!!

Thanks

View 14 Replies View Related

Modules & VBA :: Using Combo Box To Filter Records From A Form?

Oct 1, 2014

I am using combo box to filter records from a form. The data source for the form is from a query.

I use the combo box within the query to filter the data, I would like the form to refresh/ run the query again every time a new selection is made from the combo box.

View 2 Replies View Related

Queries :: Filter Data From A Table Using Combo Box In A Form

Feb 19, 2015

I would like to filter a data from a table using a combo box in a form.

The field I would like to filter is called ManufacturersID in MainTable and consist of text and wildcard characters [e.g., Teledyne O&G (ODI), TE Connectivity (Deutsch), etc...], so are the combo strings which are extracted from the table ManufacturersTable. It is not filtering anything. I suspect that the wildcards and spaces are the problem. I also tried to get the combo string to a text box in the form and use it in the query with no success. Additionally, I also tried Like [Forms]![FormName]![textbox] in query criteria but still not filtering...

How can I overcome this?

View 2 Replies View Related

Queries :: Count Function Breaks Form When No Records Meet Criteria

Aug 10, 2015

I have the following code

SELECT Count(T_STUDENTS.studentsID) AS res1yes, T_COACHING.COACH1res, T_COACHING.COACH1port, T_COACHING.COACHworkgroup
FROM T_STUDENTS, T_COACHING
WHERE (((T_STUDENTS.res_vrijstelling)=False) And ((T_STUDENTS.stud_year)="1") And ((T_STUDENTS.stud_coach)=forms!F_cboCOACHING!cboCOACHING))
GROUP BY T_COACHING.COACH1res, T_COACHING.COACH1port, T_COACHING.COACHworkgroup;

It runs fine, untill the moment the count is 0. At that point it breaks the form. How can i tell access to deal with this? Somehow i need to replace the count result with 0 if there are no records that meet the criteria.

View 8 Replies View Related

Queries :: Failing To Filter By Criteria After Return Values From A Function?

May 15, 2013

I have two date fields in a table. I need to find the days between these dates and, if its greater than 7 days, I want to display the record in a report, so far, I have found a hand function that allows me to enter two dates and it returns a long data value representing the number of days in between the two dates. (google "I've developed the following code to count the business days between 2 dates." and its the second one that starts as SOLVED I made no mods to it as it does what i need it to do.

So, i added this to its own module within the data base for use within a query. My test query basically displays the unique ID, the start date and the end date and then displays the values returned from the function. here is the SQL:

SELECT [Main Table].[Unique ID], [Main Table].[Start date], [Main Table].[End Date], (Business_Days_Between([End Date],[Start date])) AS [Days between]
FROM [Main Table]
WHERE ((([Main Table].[Start date]) Is Not Null) AND (([Main Table].[End Date]) Is Not Null));

When ran, this Query works... However, when I enter a criteria like =2 or > 7, it says data type mismatch. I have even attempted the CInt() function to make sure its formated as int but i continue to get the same error.

View 11 Replies View Related

How To Create Filter Button On Form And Filter Records

Nov 26, 2012

How can I create a "Filter Button" on a form and filter my records? I create a textbox on a form and a filter button on the right. Then I click the filter futton, the filter function will search/match the content in the box through the datasheet. And then the results of the filtering will be pop up on the split form datasheet.

View 3 Replies View Related

Combo Box To Filter Records In A Subform

Aug 14, 2014

I have a combo box located on one of my forms, that is getting its information from a field in a table.This table has all its records displayed in a subform. I would like the combo box to basically requery the subform to only show records where the name matches what is in the combo box.

It is basically a list of customers, so if I was to select Person1 in the combo box, I would only want to see records for Person1 in the subform.I would also need a way of clearing the search results, in order to get the subform to display all records again.

View 9 Replies View Related

Combo Filter Selection Affects All Records

Nov 18, 2004

this is a re-post - can anyone help? I think this is an easy one for the experts out there!

I have a form called frmTshtExp which is bound to a query called qryTshtExpenses. Most of the fileds in the form are combos and text boxes bound to the fields in the queries.

However, the first combo is unbound. It is called cboProjectSelect and it filters the second combo called cboWorkstreamExp. This is done using a query called qryTshtWorkstreamExp which has workstreamID, workstream and projectID as fields.

The filter works fine. The trouble is that selecting a project from the first combo filters workstreams from the second combo for ALL records that are entered. In other words, no matter how many rows are entered in the datasheet on the form, they all have to have a workstream belonging to just ONE project. I want to be able to enter different workstreams belonging to DIFFERENT projects on each row.

I hope you can help. I've put in a reduced version of my db in the following location:

http://uk.f2.pg.briefcase.yahoo.com...rum.zip&.src=bc

unfortunately, I didn't know how to disable the securities I've set up, so you need to log use the shortcut (after modifying the target location in it's properties) and use the word "forum" as username and password.

Thanks in advance

Sunil

View 1 Replies View Related

Reports :: Filter Records After Selected Record Combo Box

Sep 2, 2013

i have a combo box, which looks up a list of school names from my main table. The user selects the desired school, then clicks the button underneath, which opens a report. What i want the report to show is the next 31 (that is how many fit on one page) schools AFTER the school that the user selects - the underlying query for the report has them in alphabetical order. There are ~250 schools in the list.Even if i can get it just to display the records after the selected one on the form, that would be fine.

View 4 Replies View Related

General :: How To Filter Records Using Multiple Combo Boxes

Jun 29, 2014

I have a table with the following 5 fields. (Service Type), (Valve Name),(Size),(Rating),(Description).

I want to do two thing:

First: I want to select the required information from the first 4 fields using combo boxes and get the last field (description) based on the selected 4 fields. In other words, i want the record to be filtered using first 4 fields to give me the last field info.

Second: I want to store the filtered record (all 5 fields) in another table.

View 6 Replies View Related

Queries :: Filter From Combo Box Also Has IIF Statement?

Mar 15, 2013

Here is what I have in my Query
IIf([Forms]![Report Form]![Combo56]=0,1 or 3,[Forms]![Report Form]![Combo56])

in the combo box I have it setup like this
Yes = 1
No = 3
All = 0

it is pulling for a SQL database and what I am looking to do is if they want them all select 1 and 3 but when I save the Query is changes it to this and doesn't work.

IIf([Forms]![Report Form]![Combo56]=0,([BigAssQuery MTD].[Calc_ID])=1 Or ([BigAssQuery MTD].[Calc_ID])=3,[Forms]![Report Form]![Combo56])

View 2 Replies View Related

Queries :: Filter Query From Combo Box

Nov 18, 2013

On my database, I have 2 forms. One is to enter data into a Master table, and the other is to specify search terms for a query, and I'm having a problem with the search form.

I've got 2 combo boxes, a tick box and some text boxes which I use to specify criteria for the query. All of the text boxes and the tick box work fine, however the combo boxes are giving me trouble.

I'm using the critera Like "*" & Form![SearchForm]![Combo/Text/Whatever1] & "*" for the text boxes and tick box and this worked fine. However, no matter what way I try to use this, it doesn't work for the combo box. I've tried manipulating the Like function as much as possible, with and without the wildcards, the & signs, everything.

What happens is that either they do not filter out results at all and don't affect the query, or they bring up a blank query if I leave the combo box blank.

View 4 Replies View Related

Queries :: Cascading Combo Box - Filter By Field?

Mar 16, 2013

I want to create a cascading combo box - so far so simple, but in all the tutorials I can find the options in the second combo box are exclusive to the first e.g. combo box 1 selects "state", combo box 2 then displays "city". Each city can only be in one state.

In my scenario each city is in several different states - and so far I'm failing to come up with any sort of strategy as to how to deal with this. I tried giving each state a "yes/no" formatted field in the "city" table, figuring if I could use the first combo box to point access to the right field in the "city" table I could filter those records by "WHERE [fieldnominatedbycombobox1] =True" - but I don't know how to make a one combo box determine which field a subsequent combo box filters by.

View 13 Replies View Related

Queries :: How To Filter One Field With 2 Combo Boxes

Jan 31, 2014

I have 2 unbound combo box's on a form 1 called cboclient1 and the another called cboclient2. would like to be able to filter field name client name twice by cboclient1 and cboclient2 here my sql from my query

Code:
WHERE (((Assets.Client)=Forms![report gen]!cboclient1)) Or (((Forms![report gen]!Cboclient1) Is Null));

This works perfectly for cboclient1 problem comes when I try and add cboclient2

I have tried

Code:
WHERE (((Assets.Client)=Forms![report gen]!cboclient1)) Or (((Forms![report gen]!Cboclient1) Is Null))AND(((Assets.Client)=Forms![report gen]!cboclient2)) Or (((Forms![report gen]!Cboclient2) Is Null));[/

This doesn't work at all....

View 2 Replies View Related

Queries :: Multiple Combo Boxes To Filter A Listbox

Jul 13, 2015

I have a form where I am trying to use 4 combo boxes(nomenclature,BPN,vendor, and reference) to filter a list box containing part numbers. The way I have it set up right now is in the listbox it is searching for each field and then in the criteria section i have [Forms]![myform]![respectedFieldsCombo].

This works when selections are made from the combo boxes but when one is blank (not being used to filter) then I assume it passes null for that value and the listbox doesn't return anything. I have tried to make it so the listbox ignores null values but im still having this problem.

For example: If i only have a selection for the vendor combo box then i want the list box to show all respective part numbers for that vendor, where nomenclature or any of the other fields are irrelevant. I also want to be able to stack these filters upon every new combo box selection.

View 7 Replies View Related

Queries :: To Filter Several Records In 2 Different Fields

Dec 18, 2013

It have several fields, and the fields that I want to filter is ItemNo and SellingPrice.The problem is ItemNo has many different SellingPrice. I put a parameter in SellingPrice field as >=75 only for ItemNo "49565", but still i want to show other record in ItemNo and do not have filter in SellingPrice field.

View 3 Replies View Related

Queries :: Query To Filter Records Between Dates

Feb 19, 2015

I have a few queries which are used to create reminder email on training which is due for renewal.Some training required reminder 6 months before 2 year expiry. I use this in the criteria for the training date within query:

Between DateSerial(Year(Date()),Month(Date())-18,1) And DateSerial(Year(Date()),Month(Date())-17,0)

Some training required reminder 3 months before 1 year expiry. I use this in the criteria for the training date within query:

Between DateSerial(Year(Date()),Month(Date())-9,1) And DateSerial(Year(Date()),Month(Date())-8,0)

My problem is with training requiring reminder 6 months before 3 year expiry. Using this criteria:

Between DateSerial(Year(Date()),Month(Date())-30,1) And DateSerial(Year(Date()),Month(Date())-29,0)

Doesn't show any results (although there is training which was done 30months ago, expiring in 6 months time).

Changing the -30 (months) and -29 (months) in above down to -22 & -21 shows records as expected, but anything below -22/-21 doesn't show any records.

View 3 Replies View Related

Queries :: Including Date To Filter Records

Jul 1, 2013

I have a query that pulls scores for this month only for each class member. Problem is, I only need a count of these scores (per person) and because the date is in the query, it doesn't group the scores together and count them as one. i.e. it sees score 1 and score 2 as separate because they have different dates so they won't count together.

The only purpose of date in this query is to filter out only this month's dates. Is there some advanced query expression something or other that will tell it to leave date out of the count and only use it to filter?

View 2 Replies View Related

Queries :: Filter Records Depending On Subform Value?

May 20, 2013

I have a database that tracks Construction projects. Each project can have multiple Managers, so I have a many to many relationship set up with tblProjects, tblProjects_Managers and tblManagers. I created frmProjects and sbfrmProjects_Managers. sbfrmProjects_Managers has a combo box control and is continuous. Its record source is tblProjects_Managers, its control source is ManagersID (the foreign key in tblProjects_Managers) and its row source is SELECT tblManagers.ManagersID, tblManagers.Managers FROM tblManagers ORDER BY tblManagers.Managers;. The bound column is 1, the column count is 2, and the widths are 0";4". When adding sbfrmProjects_Managers to frmProjects I made the child-master link with ProjectsID, the PK of tblProjects and the other foreign key in tblProjects_Managers.

I need the Managers to be able to do a search that will return only the projects that they manage. I've tried making a query composed of tblProjects, tblProjects_Managers, and tblManagers. I used the field ProjectsID from tblProjects and ManagerName (with the criteria Like [Manager's Name] & "*") from tblManager. The query worked when run by itself, but when I use it as a filter in a macro to open frmProjects, I get two prompts to enter a value, one that asks for tblManagers.ManagerName and one that asks for Manager's Name. No matter what I do I can't get only the second dialouge box to appear, and regardless I no matter what I enter into the two dialogue boxes my results aren't filtered at all.

View 1 Replies View Related

Queries :: Join 2 Tables But Filter Records

Jul 20, 2015

I want a query that gives me something like this from 2 different tables:

table1 - AA, AC, DE
table2 - AA01, AA02, AA03, AC01, DE01, DE02

query -
column 1 - column 2
AA - AA01
------ AA02
------ AA03
AC - AC01
DE - DE01
------ DE02

Is that possible?

View 3 Replies View Related

General :: Filter Form From Combo Box

Jun 6, 2014

I have a form that has many fields with the same part number but with a different PO number

Example

part number po number

1 3
1 10
1 15

What I want to do is select the part number and the po number together

Say part number I po number 15

At present my combo box only will select one of these IE THE part number ...

View 2 Replies View Related

Queries :: Filter Using Date Range But Show All Records If Text Box Null

Jan 13, 2014

I m trying to make form which filters my records and generates a report..here's where I am

Code:
Like "*" Or Between [Forms]![Form1]![Text6] And [Forms]![Form1]![Text8] & "*"

but this doesn't work I would like to show all records if textbox 6 is null and textbox8 is null this part of code works perfect but below but I'm struggling to get the between in with the code

Code:
Like "*" & [Forms]![Form1]![Text6] & "*"

the code is in report record source

View 9 Replies View Related

Queries :: Unable To Make Crosstab Query To Filter Records From Table

Sep 17, 2013

I am trying to make a crosstab query to filter my records from my table.

Here is the scenario.

I want to make a query that will return me my Rep ID, Rep Name, his Bonus and his GV-Q (another value) based on every month.

Now I make a crosstab query and here is the syntax.

Code:
TRANSFORM First([TBL Qualification Data India].[Bonus Rank]) AS [FirstOfBonus Rank]
SELECT [TBL Qualification Data India].[Rep #], [TBL Qualification Data India].[Rep Name]
FROM [TBL Qualification Data India]
GROUP BY [TBL Qualification Data India].[Rep #], [TBL Qualification Data India].[Rep Name]
PIVOT [TBL Qualification Data India].Period;

This resulted in a column for Rep Number, one column for Rep Name and columns for all the period of Bonus I am going to have., so there are basically 9 columns for this till this month for each month and bonus value shows as values for all these month (period) columns.

Now in this same syntax, I want to have my Rep GV-Q value as well as his bonus to show in the same query, I read and came to know that it's not possible to directly have two values or two column headings in a crosstab query, I must have to make a new crosstab query and then use a normal select query to display records from these two crosstab queries, so I went ahead and made a new similar but with one value field changed crosstab query and here is the syntax for that.

Code:

TRANSFORM First([TBL Qualification Data India].[GV-Q]) AS [FirstOfGV-Q]
SELECT [TBL Qualification Data India].[Rep #], [TBL Qualification Data India].[Rep Name]
FROM [TBL Qualification Data India]
GROUP BY [TBL Qualification Data India].[Rep #], [TBL Qualification Data India].[Rep Name]
PIVOT [TBL Qualification Data India].Period;

Now after this how to make a select query to show the data from these two queries.

I can make a normal query based on these two crosstab queries and manually add all fields and then I would have my result but then after every month I have to manually enter these two extra month details from both crosstab queries to my final query and that's not what I want.

Is there any method to do this by gathering data from these two queries into one and achieve the result I want or if there is any other approach to tackle this.

To explain my database and my need for output, I am attaching few pics to make things easier if I made some mistakes in explaining my problem. It's included in attached zip since I am not able to post images or links.

View 5 Replies View Related

Filter Combo Box Query From A Form Field

Feb 21, 2008

If anybody could shine some light it would be much appreciated.
I have 3 tables:
Task table---*Task ID, Task(txt), Start(date/Time), finish(date/Time)
Tasking table---*TaskingID, TaskID, EmployeeID
employee table---*EmployeeID, Name(txt)
The employee and task table are joined to the tasking table. This is so i can have a task which has many employees and an employee with many tasks. What i'm try to do is create a form which starts a task with a subform to add employees, but with combo box which filters employees with tasks which over-lap the task in focus(start and finish fields) but still showing employees which do not yet have any tasks. the start and finish fields are hh:nn dd/mm/yy.
If anybody can help i would be very grateful

Jim

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved