Running A Query Based On A Combo Box Within A Form

Apr 6, 2012

how I can have a combo box on a form, and once a value is picked, return a query that displays all the data based on that value. I have tried using sub forms and the after update but I cant seem to figure it out.

View Replies


ADVERTISEMENT

Running A Query Based On Item In Combo Box

Nov 12, 2004

I am trying to select the records I want displayed by what category is chosen in the combo box.

Say there are two fields in the combo box: Red / Blue

I want the query to only display the records associated with the Red Category.

If I set the criteria in the query to [Show only Red] and type in Red when the query is run I get blank lines.

Is there an issue when choosing a category from a combo box for the query to be specific on?

My other issue is.... does the problem originate because I am trying to run a query from a table that is being filled in by typing the
information into a form? I wouldn't think so, but I am not sure.

Thanks,
ChrisB37

View 5 Replies View Related

Running A Query Based On A Select Record In The Form

Jun 13, 2006

Hi,

I have a query that I would like to run from a form. I have created the button and the query, but want to add in a clause that will use the user selected record / field as the criteria for the query when its run.

Got any examples of code I could have a play with

I am struggling here so need any help I can get!!

Cheers
Paul

View 1 Replies View Related

Forms :: Running A Query Based On User Selection Criteria On Form

Jan 9, 2014

I 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.

View 5 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 :: 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

Forms :: Running A Query Based Upon A Listbox Selection?

May 1, 2015

I have a list box that is correctly listing resources from a table (tblResource). I would like to select one of the list box entry and run a query against the tblResource to show the information for that resource in a form. I have tried to use the lstindex with the control (lstResource) in the where clause of a query to accomplish this with no success.

View 5 Replies View Related

Running A Query By A Selection From A Combo Box

Dec 10, 2007

I have a query that runs info selected from safety visits. I have made a form with an unbound combobox that selects the supervisors name and after the name is selected, I have a button to run the query. When a name is selected, the query comes up blank. When I do not select the name, the query is populated.

My criteria on the query is [forms]![personnel]![combo9]

Combo9 is the unbound dropdown menu with the supervisors name that is taken from a table of names.

Any help?

Thanks in advance.:(

View 1 Replies View Related

Display Combo Box Before Running Query

Mar 14, 2008

Hello I have Supply order Database
I want to display combo box
after selecting the month the query will run

plz tell me how to do it.......


kindly reply

if any 1

thanks

View 3 Replies View Related

Problem Running A Query Based On Date Criteria Over Previous 7 Day

Mar 19, 2008

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

View 2 Replies View Related

Reports :: Access 2007 Crashes When Running Report Based On Query

Apr 14, 2014

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 Related

Forms :: Change Record Source Of Combo Box On Form Based On Another Combo Box

Mar 31, 2014

I have a form that currently uses a "catch all" table for listing available equipment to choose from for an equipment field. I call it tblEquipment. What I want to do is to make it so when I type a name in (1 of 35) in one field of the current record, the record source for the equipment field immediately looks at a different table that has equipment available only for that name. To do this I plan on making 35 different tables with limited data originally found in tblEquipment. I would call these tblEquipment1, tblEquipment2, etc. I do not use a sub form, nor do I want to.

So my questions are:

1) can this be done
2)If it can be done, how can I do it?

View 3 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

Running Query With Form Data

Aug 31, 2006

I have a form that has a start date field and an end date field and a client ID field. When I click a button to run a query I want the query to take the start date and end date and filter the query on those dates and also only supply data for the client ID

at the moment when I run the query i manually type the start date and end date and then scroll down the client ID to the one I want.

any ideas how to do this from the form

many thanks

View 2 Replies View Related

Running A Delete Query From A Form

Jan 19, 2007

I have code in my form using Do.Cmd:

stDocName = "QueryName"
DoCmd.OpenQuery stDocName, acNormal, acEdit

which is code created using the Access Wizard.

I have another delete query that I wish to run from the form but when I edit the QueryName to be the name of the query it doesn't run and if I use the wizard to select the query from the list the delete queries do not appear. The query runs fine when executed separately - i.e. not from the form.

Is there an alternate syntax to the above to run delete queries or something that I need to change in the delete query itself so that it can be run from my form?

All help welcome

View 1 Replies View Related

Forms :: Parameter Based Query - Filter A Form Based On Another Form

Mar 20, 2013

I have a form which uses a parameter based query to present an individual senior doctor with a list of names for of individual juniors to provide an assessment report on. When the first form opens the user enters their RespondentID.

Once senior has decided which names to comment on I have another form which has the questions to be answered which is opened by clicking a button on the first form.

How can I pass a parameter from the first form to the second so that only the records relevant to that senior doctor are displayed? The underlying table has 60 senior doctors and 20 junior doctors. The senior doctor is identified by the field RespondentID in the first form. I've tried putting a WhereClause in the FormOpen command but I still get a dialogue box asking for the parameter RespondentID when the second form is opened.

View 2 Replies View Related

Help With Running Query From Info Keyed In Form

Feb 22, 2005

I need help to figure out how to create a form that includes a place to enter date ranges (A start and an end date: the field name in the table is CrossClampDate), patient name, and case number as a search. I have just taken 3 levels of Access classes and saw an example of this, but we never went into it and from the Properties box for all parts of the form I still can't decipher how it was done.

Basically, I want to run the operations a query goes through by inputing this information in a form.

I have created an actual query that performs this operation, and it works. But I am prompted for each criteria separately in individual pop up boxes. I just need to streamline this operation for the users.

Any help would be GREATLY appreciated!!!

View 1 Replies View Related

Forms :: Display Form Without Running Query

Mar 29, 2014

I have a form with a select query running as record source. Once the input for the select query is entered the form runs. Then after that there are some manipulations in the form and it is displayed. In this second phase the form must be displayed without running the same query again. How can I do this?

View 8 Replies View Related

Query Based On 1-4 Combo Boxes

May 17, 2007

I have a rather simple query that will produce filtered results based on the user's selection in 1 to 4 separate combo boxes on a form. But I can't get it to do what I want it to do. Here are my vitals:

Form = frmQryAdHoc
City combo box = cboCity (from tblWARNData)
County combo box = cboCounty (from tblCounties)
MWA combo box = cboWMA (from tblLookUpData)

Query = qryAdHoc (source = tblWARNData)
CoCity column criteria = [Forms]![frmQryAdHoc]![cboCity]
CoCounty column criteria = [Forms]![frmQryAdHoc]![cboCounty]
CoMWA column criteria = [Forms]![frmQryAdHoc]![cboMWA]

The query works fine if I make selections in all 3 combo boxes. However, if I make a selection in only cboCity, the query returns no results because it doesn't find a matching record where the city = cboCity and the County and MWA fields are blank.

Here's how I want it to work:

If cboCity = Detroit and cboCounty = Wayne, then
Results = 40 records (where city = Detroit AND county = Wayne)

But if cboCounty = Wayne and cboCity & cboMWA are blank, then
Results = 120 records (where county = Wayne; cities & MWAs = various)

IOW, I want the query to filter only on the cbo's where a selection has been made by the user and ignore any empty cbo's. What statement do I need to enter in each cbo-related criteria field so the query filters only on the combo boxes where a selection has been made by the user?

Any help you can provide will be greatly appreciated. Thank you.

View 3 Replies View Related

Running A Procedure Based On Time

Jan 6, 2005

Hi

How do you run a procedure that activates at a set time?
I want to run a procedure that moves a log file to an archive directory at midnight (or at anytime after this when the PC is next turned on).
Thanks for any help...
Mat

View 1 Replies View Related

Print Form Based On Combo Selection?

Apr 10, 2006

Hello!

I have almost completed my database, everything I had originally intended to implement into it has been done, with some extra added features I popped in along the way. There is just one more thing I require assistance with...

My database is used for booking camera kits in and out. On the add booking form the user has to pick a "Camera Type" from a combo box. When they have made their selection, a form pops up with details of all of the components contained within the kits. The user can then check/uncheck the relevant components and close the form.

I have used a command button which prints off the data contained within the current booking form, and also the data contained in the form that pops up when the camera type is selected.

However, as there are more than 1 different types of camera, comprising different components, I need to be able to print off the form relevant to the kit type.

I do not know how I can do this as I have just specified the command button to print the form for the default kit.

I basically need some VB code which will print the form based on my combo selection, as my knowledge of VB is pretty primitive, I was wondering if someone could help me out :)

Any help would be appreciated!

View 2 Replies View Related

Open Subform Based On Form With Combo Box

Oct 27, 2005

I have a main form (FRMProspects) with a combo box (ComboCoName) that has a query as it's record source to sort the records displayed in it. It is bound by the CustID (autonumber), but displays the CompanyName.

What I want to do is open a sub form FRMNotes, based on the Company name that is selected in the ComboCoName. So for Company XY, I want to click on the Notes command button to open up all the notes for that company only (filtered). FRMNotes is based on a different table, but TBLProspects and TBLNotes are linked by CustID (one to many).

What code do I need for this? I am treading water with VBA!

View 4 Replies View Related

Refreshing A Query Based On A Combo Box Selection

Dec 1, 2004

I have a form on which i make a selection. This selection then populates a query which in turn generates a report. The problem that i have is that when i go back into my form and make another selection the query, and therefore the report, holds the original data.

My question is how can i refresh the selection and therefore produce different reports based on this selection without exiting the application?

Many thanks for any help provided in advance.

View 4 Replies View Related

I Need A Query To Reflect A Value Based On Combo Box Selections

Apr 11, 2006

Hi all,

In my database, different Customers have different Rates.

I am trying to run a query that will pull a value dependent upon The Service Type & Customer that have been selected from combo boxes.

My database tables are as follows;

(Rate Profile Table)
RateID
ON8
ON11
SD

(Customer Profile Table)
CustomerID
CustomerName
CustAddress
RateID

(Shipments Table)
ShipmentID
WaybillNo
Date
ServiceTypeID

The ServiceTypeID is selected on the Shipments Form by making a selection from a combo box that has been populated by the RateID Table Field Names (which are the service types).

Everything works fine but I need to be able to run a query to calculate the freight charge (from the appropriate rate in the Rate Profile Table) according to which Customer & Service Type has been selected, but not having much joy.

I would be extremely grateful if someone could point me in the right condition.

Thx...

View 8 Replies View Related

Forms :: Retrieving Value Through Combo Box Based On Query

Sep 26, 2013

I have 4 tables:

table 1: two fields: t_code (primary key), town_name
table 2: two fields: Distri_code (Primary Key), Distri_name
Table 3:two fields: T_D (Primary key), t_code (foreign key), distri_code (foreign key)
Table 4:A_T (Prim key), T_D (Foreign key), area_code (foreign key)
table 5: area_code (pri key), area

I want to make a form on table 4 where both foreign keys are numbers. On the data entry form on this child table, i am trying to link towns and areas. At the front end form, i want a combo or list item showing town_name (table1) and distri_name (table 2).

Once the end user selects the required town and district from available options, i want to retrieve T_D from table 3 through query based on input from both values and save it table 4 in place of T_D along with area_code, which i can retrieve simply from table 5.

View 1 Replies View Related

Queries :: Using Input From A Form As Criteria - Error When Running Report / Query

Aug 18, 2015

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.

View 8 Replies View Related







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