Queries :: Filtering Query Based On Form

Jan 16, 2014

I have a form named form1. In the form I have two unbound text boxes formated as general date; startdate and enddate are the text box names. In my query criteria for the ContactDateTime field I put the following code

Code:
[Forms]![Form1]![StartDate] And [Forms]![Form1]![EndDate]

When I run it I don't get any results. So it runs but no records come up. I have about five queries that run when I click a button and I want to be able to just select start and end dates once on the form and have all the quieries run.

View Replies


ADVERTISEMENT

Queries :: Drop Down - Query Not Combining And Filtering Values Based On A Form

Jul 22, 2014

I have a form (DropDown form) that has 3 drop down fields, you select your values from the drop downs and you would push a command button that runs an event procedure which runs a query (DropDown qry test). The user should have the option of picking any combination of fields to filter by. Or no combination, which would return all values in all fields. So I am basically using the form as parameter's for the query.

The problem I'm having is that my query is returning values for one field AND values for another field. Even if the other values selected are not in the same record. It's not combining the fields together to filter. For example: you pick a Project name and Supplier name, the query will return records that have the project name you selected but it will also return records with the supplier name you selected that have a different project name.

I've attached screen shots of the form and the design view of the query (the screen shot cut off the last column name. It is meant to say "Expr3: [Forms]![DropDown form]![Combo7]").

Using Windows 7,
Access 2010

Is there a way to select multiple values from the drop downs?

View 14 Replies View Related

Queries :: Form Filtering And Creating Query - Move Top X To New Table

Jan 24, 2015

Tried to find things but being a mix of a couple of different actions havn't been able to actually find it

So basically I found a awesome form somewhere that builds the SQL query based on all the users selections.

When you hit the create button it will save the query and update the sub data sheet below with your query results.

From here the part I'm lost on is getting the TOP x number of records and moving them to a new table, I wanted it to work on the 2 drop down boxes that are on the form. select your values and hit the button.

I'd imagine it would be a sub query that I'd use for the top x like I have in the past but I just can't seem to get it to work

Quick steps

1. create your query
2. check your data in the sub datasheet
3. decide the number of records to move to the new table
4. select the name
5. hit the button

This would copy the ban, xcv & dfs fields from the importeddata table to the moverecordshere table & also update persname in the moverecordshere table with the name selected in the form.

Sample db attached ....

View 1 Replies View Related

Queries :: Query To Run Before Report Based On Criteria Based From Two Combo Boxes On Form

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

Filtering A Form Based Off A List Box?

Mar 24, 2005

how do i filter a form based off what you select in a list box?

thanks
chad

View 7 Replies View Related

Filtering Report Based On Records In A Form

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

Forms :: Filtering A Form Based On ADODB Recordset?

Oct 16, 2013

I have a form that shows records from ADODB recordset.When I try to apply filter to the underlying recordset it works all right but the form doesn't reflect the changes. It shows same rows as before filtering. In debug I can see that the recordset contains only filtered records. Me.Refresh (Recalc, Requery) doesn't work.

Code is as follows:

Dim rs As New ADODB.Recordset
rs.Open sql, conn, adOpenStatic, adLockOptimistic
Set Me.Recordset = rs

Sub combo_AfterUpdate()
Me.Recordset.Filter = "CompanyNo = 123"
End Sub

The form is in Continuous forms mode. I cant use DAO because the data comes from SQL server user-defined function.

View 5 Replies View Related

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 14 Replies View Related

Queries :: Search Query Based On Form?

Nov 13, 2013

I am unable to get multiple search output using the below code in queries, the search text is based on form :

Search form name : Find
Query name : Search
Table name : Sheet1
[forms]![find]![city]

The above works fine if it is only used in one of the fields, but as soon as I have it in multiple fields the output is null.

I am aware that i can used Like "*" code, but the thing I want to find records which are perfectly matching based on the form.

View 14 Replies View Related

Queries :: Set Criteria On A Query Based On If A Form Is Open Or Not?

Jun 18, 2015

What I want to do is set the criteria of a query to the value on a form if the form is open, and set it to a different value if the form is closed. I tried using a function on the OnLoad event of the form to set a variable called IsOpen to 1 if the form is open, and reset that variable to 0 when the form closes, but when I tried using the variable in an IIF statement in the query criteria, I got a "Its too complex" error.

Here's what I really want to do. I have a very complex form with multiple tabs and subforms. The subforms populate based on a query of what is selected and loaded into a textbox control on the first tab of the form. The first tab has a subform that is based on the main table. Rather than recreate that form, I want to copy it and change the rowsource on the first tab to a subset of the main table, and tell the query to use the textbox on the new form so I don't have to go and replicate all the other subforms. Is there a way to do that or am I just screwed?

View 3 Replies View Related

Queries :: Dynamic Query Based On A Form (ComboBox)

Jan 22, 2014

We have a ComboBox on a form with the months: Jan, Feb, Mar, Apr, etc.

We have fields in a budget table named: Jan, Feb, Mar, Apr, etc.

We want to create a query that pulls the correct field based on the value in the combo box.

This is what I have that doesn't work:

MyField: [Query1].[SumOf] & Forms![Main Menu]![test]

How to do this?

View 4 Replies View Related

Queries :: Change Query Field Based On A Form

Oct 29, 2013

I need a query's field to change to what is selected in a combo box.

Example,

I select product 1 in the combo box on a continuous form, after the update there is a requery. The form now displays the data from product 1.

I have tried putting [forms]![form1]![combo1] into the field box of the query. But this only makes the form display "product 1" in every row, it does not take any data from the table.

View 3 Replies View Related

Queries :: Dynamically Add Fields To SQL Or Query Based On Form Selection

Nov 6, 2013

Is it possible to add a field (i.e., variable) to a query (or SQL programming) based on a form selection?For instance, if I use a form to allow an end-user to specify which fields they wish to include in the query (essentially creating a UI for the query builder), how would I go about creating the query/SQL or updating the query/SQL?

View 3 Replies View Related

Queries :: Query Results Based On 2 Form Control Values

Oct 29, 2014

I have 2 form controls one a combobox and the other a text box. The text box select the site (txtLocation) where the user can enter part of the name of the site and all sites with those characters are returned. I've done this by adding:

Code:
Like [Forms]![frmSearchDB2]![txtLocation] & "*"

into the criteria on the Site field in the query design editor.I also want the combobox to have an affect on the query. I want it to query on user status. However if the combobox reads "All Users" I want it to return all status's and all null values. In the criteria field I put:

Code:
iif([Forms]![frmSearchDB2]![cbxUserStatus] = "All Users",like "*",[Forms]![frmSearchDB2]![cbxUserStatus])

It kind of works but no null values are pulled back. Should it be an expression?Do I need to do it in VBA?

View 1 Replies View Related

Queries :: Open A Query Based On Two Or More Fields Of A Continuous Form

Nov 22, 2013

I have a subform which is a continuous form displaying a single combobox of trade names so there may be up to 4 or 5.i want to click on a button on the main form which will open a form based on a query that will display all personnel matching all or 1 of the trades in the subform?

View 2 Replies View Related

Queries :: Query Based On A Form Which Had Field Names And Some Values

Feb 26, 2014

I have a table listing about 20 elements as field names eg FE, CR, NI, TI and so on.

I have built a form which has a combo box listing these elements by selecting "fields" in the property settings of the combo box & next to this combo box i have 2 text box's where the user can input Min & Max values to pass on to the query.

E.g., FE (chosen from the combo box) value between (Text box1) and Text box 2.

I can run the query to give me values between the 2 text box's by using the following formula in the criteria (Between textbox1 and textbox 2).

The issue i have is to be able to select the element from the listbox, input the min & max values identified and be able to pass this to a query so the query can filter based on the field and values passed?

View 3 Replies View Related

Queries :: Differentiate A Query Based On All Group Records Or A Query Based On Only One Record

Dec 22, 2014

I have a combo named cbogroup. I have a tblGroup with several records (active, non-active, nursery, etc.). One of the records is *ALL*. Using the CboGroup the user can pick any of the records. Howeverr, if they pick the *ALL* record, I want the query to pull up animalID based on all records in the TblGroup. If another record is picked (i.e. nursery), then the query will pull up only animalIDs that are in the 'Nursery'.Can I put a (iff then) in a query in order to differentiate a query based on all group records or a query based on only one record?

View 14 Replies View Related

Queries :: MS Access 2010 - Put Month On A Form Based On Data In Query?

Mar 26, 2014

How do you put the Month on a form based on the data in a query?

View 1 Replies View Related

Queries :: Slow Query Filtering On Concatenated Variable

Jul 9, 2015

I am trying to use a criteria to filter out nulls in concatenated variable, which slows the query considerably.The part that makes it slow looks like this -

WHERE ... AND (([tbl1].[x] & [tbl1].[y]) <> "") AND ...

If I work them individually, it's not a problem, the query is fast, but I have to combine them first in order to produce the correct output.

View 13 Replies View Related

Queries :: Filtering Query With Text Box And Combo Boxes

Jul 23, 2015

I am creating a query that should filter records of events based on multiple fields. The filters should work with any combination of field criteria, but only two of the four field are working properly, as follows:

1. a text box for searching with event name (free text) - this is working;
2. a combo box to filter events by country name - this is working;
3. a combo box to filter events by event's keyword (category) - this is NOT working;
4. a combo box to filter events by year - this is NOT working

View 2 Replies View Related

Queries :: Running Query Based On Form Text Box Criteria With Special Features

Dec 18, 2013

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]'.

View 2 Replies View Related

Queries :: Form List Based On A Query Returns Original ID Value Not Field Text

Aug 14, 2014

I have a table x where the field value is selected via a combo box in a form that is populated from another table z.

When I look in x, it appears to have correctly stored the text from z, not the ID number.

I then built a Query, qX, which looks in x and grabs the fields I want. That query shows the text correctly in each selected field.

Now when I build a form, frmQx and use a List control, it displays some of the fields as ID values from the original table z, not the text values.

How can I get round this? I've searched and searched for an answer, sigh. Maybe I'm just not quite certain how to phrase the search.

View 5 Replies View Related

Queries :: MS Access Cross Tab Query - Date Range Filtering

Aug 14, 2013

I just wanted to know how can i set a parameter on the following cross tab query to filter dates. Date field is [pdate By Day].

TRANSFORM Sum([PettyMaster Query2].Amount) AS SumOfAmount
SELECT [PettyMaster Query2].[Petty Cat].Field2, [PettyMaster Query2].[pdate By Day], [PettyMaster Query2].ProjLoc, [PettyMaster Query2].descriptionofpay, [PettyMaster Query2].projno
FROM PettyMaster, [PettyMaster Query2]
GROUP BY [PettyMaster Query2].[Petty Cat].Field2, [PettyMaster Query2].[pdate By Day], [PettyMaster Query2].ProjLoc, [PettyMaster Query2].descriptionofpay, [PettyMaster Query2].projno
PIVOT [PettyMaster Query2].PettyCOA.Field2;

View 11 Replies View Related

Filtering Combo Box Based On A Value From Another Combo Box (in Multiple Items Form)

Mar 11, 2012

Let's assume we have 3 tables:

Order_Category (Order_Category_ID, Order_Type_Name) with 2 records:
1, Minor
2, Major

Order_Type (Order_Category_ID, Order_Type) with 4 records:
1, Book
1, Pencil
2, Car
2, House

Orders (Order_Category_ID, Order_Type, value) with 2 records:
1, NULL, NULL
1, NULL, NULL
2, NULL, NULL

I want to create a Multiple Items form presenting Orders table with two Combo Boxes:

1. A combo box to select Order_Category_ID.
2. A combo box to select Order_Type. When 1 (Minor) is chosen in the first combo box it should show Book and Pencil, when 2 (Major) is chosen it should show Car and House.

Examples in the Internet show how to do it on a 'single row' forms using the RowSource property. I tried to use a query like:

SELECT Order_Type
FROM Order_Type
INNER JOIN Orders ON Order_Type.Order_Category_ID = Orders.Order_Category_ID
WHERE Order_Category_ID = [comboBoxOrderCategoryID]

But it sets same values for all records in the Multiple Items form and it should return different values in each rows based on value in the first combo box (Order_Category_ID).

View 5 Replies View Related

Query Filtering From Form

May 17, 2006

I have a query that when run asks for a client ID and then displays a total of funds for that client.

I also have a form for each client's persobal details and I would like to have a command button on that form, that when clicked runs the query automatically using the client ID being used.

I can get a command button to open another form based on client ID but not a query.

many thanks

View 2 Replies View Related

Forms :: Filtering A Query Using A Form

Feb 9, 2014

I currently have this form (combobox) that filters using one piece of criteria.

Private Sub cboSelectPress_AfterUpdate()
'Moves to Press field and
'finds records where "press" matches whatever is selected in the combo box
DoCmd.ShowAllRecords
Me!Press.SetFocus
DoCmd.FindRecord Me!cboSelectPress

End Sub

"Press" is a machine number. How can I add more combo boxes to filter additional information from my query. Like "room" or "product" or "date?" What happens if the user leaves one of the boxes blank?

My fields are

"Date"- date the product was ran
"press"- the press it was ran on
"product"- the name of the product
"shift"- the shift it was ran on

I want the user to be able to select ALL or none of these fields for results.

I am using Access 2013

View 2 Replies View Related







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