Query A Query, Where It Is Based On A Form?

Jan 10, 2007

Hi All

I have a query that runs based on the contents of a date entered in a form (I will call that Query1).

I need to take the data from Query1, and then have Query 2 analyse the data (I want it to tell me where the Count of First Day is more than 5).

When I use the query design grid, I include the fields want from Query 1, and put the criteria in to say CountofFirstDay >=5; but when I run it, it asks for the data for the form (relating to Query 1)

What can I do? thanks!

Maria

View Replies


ADVERTISEMENT

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

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

Chart Based On Form Based Parameter Query

Mar 22, 2006

Hi all,

stuck on this, not sure if it can be resolved....

I have a parameter query for which the parameter is based on a form field entry (i wanted to avoid the dialog box popping up).

No problems with this....however, I want to create a chart based on the same query however, i get the following error message because it does not recognise the query parameter.

Error Message: The Microsoft Jet database engine does not recognise '[Forms]![frmChooseDTDate]!DateOccured' as a valid field name or expression.

Can this be resolved?

Help most appreciated!

regards to all

K

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

Using A Query Based Form

Mar 14, 2007

I'm working in Access 2003
I have a table of projects done by my company, which includes
-organization name
-project year
-service 1 provided
-service 2 provided
-service 3 provided
-service 4 provided
-project fee
-project consultant 1
-project consultant 2
-project consultant 3

I've created a Query Based Form where you can enter in any combination of search criteria (e.g. org name and btwn 2001-2004) and the button press runs a query that returns a table of projects that match all the criteria you've entered.

I've figured out (I have no formal Access or programming training) what to set the criteria as in the query so you can get info by entering org. name, project year (with start and end dates) and/or project fee (with bottom and top amts).

The issue that I'm having is that I want to be able to enter a consultant name into the Form, and have the query return any projects that have that consultant listed a either project consultant 1,2 or 3 - and the same idea for the service provided. Right now I can only get the query to look in the 'service 1 provided' and 'project consultant 1' columns.

I had a thought that I could run 3 different queries - 1 that will look at org, date and fee, a 2nd that will look at all consultants, and a 3rd that will look at all services - and then run a 4th that would give me a table that only showed projects that appeared in all 3 of the other queries. However I haven't been able to figure this out, nor do I know if it's the best way to achieve my desired result. Right now I have the 4th (using UNION) showing all projects that show up on ANY of the 3 queries, plus the button press makes all 4 query result tables pop up, and I'd like it if only the 4th (final) query produced a visible result.

Any ideas or help would be greatly appreciated. Thanks!

View 3 Replies View Related

Query Based On A Form

Feb 27, 2008

Hi, can anyone help? I have set up a query that looks at a list box on a form for one of its criteria and then a text box on the form for the user to also specify a date. A command button on the form runs the query. Is there any way for the query to work if the date field is unpopulated (as well as having the option to specify a date)?

Any help gratefully received x

View 5 Replies View Related

Form Based On Query?

Oct 22, 2005

I have been told that all forms should be based on a query even if you are using all of the fields and not using any criteria. I would like to know what the advantages & disadvantages of this are. Could someone please explain this to me?

View 1 Replies View Related

Query Based Form

Feb 21, 2006

Hello I am new to access development.
I read several of the entries similar to my error:
Cannot add record(s);join key of table 'dboAssets' not in recordset.

The information was previuosly in one record name inventory. This was not normalized so following a books advice, I did. Now i am having a good deal of time putting the information back together. I moved all the information gathered into the inventory table. When I try and create the form using the form wizard it creates a subform and I need it all in one form. I can recreate the nice form, but am not getting what I missed in the join. When I preview the sql view there are lots of fields that are not in my Assets table. This is more complicated than my book explained. Any assistance would be appreciated.

View 1 Replies View Related

Search Form Based On Query

Nov 24, 2006

Hi people,

i have a search form with a list box. it is based on a query. it works fine for a different project but in this project i need to search for either a perfect match for an ID, or a 'like' match for description, or a like match for the customer.

i want the list box to have the

EventID, Description, CustomerName, CustomerSurname, EventDate

i want to choose which information i enter into the unbound boxes to return results in the list box.

What formulas would i need to enter into my query as a criteria so that it works.

Thanks guys, james

View 1 Replies View Related

Limit Query Based Form

Jan 30, 2008

Hi,

I've attached a zip version of my database (which is still in the early stages of development) as I think it will be tricky to explain what I need. I've studied lots of other threads but can't find the answer I'm looking for.

Basically I have a form "Goods-in" which has a subform in continuous view that lets you pick from a product list. I'm trying to limit this combo to products that relate to this supplier only, but (it seems) because the subform is based on a query I can't update it.


I have tried several approaches but got nowehere. At this stage I don't know whether the problem is with
- how I'm linking the parent and child forms
- the SQL of the combo recordsource
- my relationships
- my overall design
- the weather!
- etc.

I would be eternally grateful if someone could take a look and advise me. The items shaded grey on the forms are just my shorthand for what will be invisible in the final version.

I'm going home now and even though I may read replies tonight, I wont be back in the office until 9am.

Thanks in advance!

View 4 Replies View Related

Updating A Form Based On A Query

Jan 31, 2005

First, let me point out that I am a new Access user, so apologies ahead of time

I have a form which has a field called 'Initials'. I want this field on the form to default to whatever was last entered (into the table called 'Main Table'). I first tried setting the default value with a DLast command, which seemed to work for a day or so, but then it returned values from mid-table - very strange

I then set up a query which does return the value of the last Initials entered (cunningly called 'Last intials entered'), but I can't get the field in the form to default to this value - it comes up with #Name?

Can anyone help, or have I not explained myself very well

Cheers

View 1 Replies View Related

Form Based On Query Problem

Jun 8, 2005

I don't know how I'm going to explain this but here it goes.

I have designed a query that counts and sums the total field of a table grouped by engineer name, which works perfectly, but on the form I am showing the resluts on I want to show the last five totals inputted into the database as well.

I am sure this must be possible some how but I can't get me head round it, any help would be much appreciated.

View 2 Replies View Related

Requery Form Based On Query

Oct 2, 2005

I have a form that is based on a query, on the form there is an option group with two options (show all and show active). This option group is the criteria for the query the form is based on. My hope was to have a requery on the after update of the option group and have it show approptiate records based on that option group.
My query does work if I open it by itself, and the form will show the appropriate records when it is initially opened. However, when I change options in the option group the query runs again but the data in the form is not changed.
I have searched every forum I know of but I have not found out how to make this work. It is like the form is not being refreshed with the new data from the query.
Lastly, this is my first large database and my knowledge of database design is a little like swiss cheese! Is there a way and would it be better to use a filter to do this? I want the user to just click an option or button to show records marked as active only or show all records. By active I mean the yes no field in the table being set to yes.

View 9 Replies View Related

Searching Form Based On Query

Dec 16, 2006

Hi,

I have a form that is based on a query with many fields. As an example there is a field called "Medium" which contains values such as "Oil on canvas", "Oil on wood" etc.

At the moment I have a filter which works fine but this doesn't allow me to search all records which have the word "Oil" as part of the Medium.

I would like to be able to search all fields on the form. I have looked at a few exmaples on the forums but could not find one that applies to my scenario.

Can anyone help?

Thanks in advance.

View 4 Replies View Related

Query Decisioning Based On Form Input

Jun 2, 2006

I have a database that has several tables, each table has account numbers in
them. I also have queries set for each table to bring in desired
information. Is it possible to set up a form so the user can input an
account number and depending on which table the account number is in, that
query will run?

View 11 Replies View Related

Change Query Based On Form Fields

Dec 19, 2006

I am trying to come up with a simple way for users to query the database and pull back entries relating to the (potentially vague) data they input.

I know how to run a query based upon data input in a form ("=[Forms]![FormName]![FieldName]"), and I know I can do this several times in one query.

However, if one of the fields is blank, the query doesn't return anything.

Is there a way to use only one query, but still allow the user to leave search criteria blank? The only thing I can think of is by using a very convoluted VB script and creating a query for each possible combination of criteria.

It's not an error-checking issue, either, as entering info into all of the fields isn't required.

For reference, the searchable fields are:
Agent Name, Beginning Date, Ending Date (intended for a date range), Request Type, and District Name.

A user could then search for any requests made by an Agent; any requests by an agent within a date range; any requests made by anyone in a date range; ad nauseum.

There are quite a few combinations, there, and I'd rather not create a query for each one (or code the VB conditionals to choose the right one).

I hope I'm clear in what I'm trying to accomplish :o

Thanks in advance!

View 6 Replies View Related

Problem With Query Based On Form Components

Feb 17, 2005

I have a form with a combo box (sup_numbers_combo), which has a list of supplier numbers in it. (on a master form).

In a sub form, i then set the row source for a combo box (product_numbers_combo) to this:

SELECT [product_number] FROM Supply_link WHERE [Supply_link].[sup_number]=[FORMS]![myForm]![sup_numbers_combo];

Hence, "Sup_number" is a PK in Supplier and an FK in Supply_link.

I want the product_numbers combo to be filled with the values of product_number in Supply_link, where the sup_number is equal to the number selected on the form.

Im pretty sure I have the query correct. If I enter it as a query and then force it a value for: [FORMS]![myForm]![sup_numbers_combo], it works fine.

However, when I set it as the row source for "product_numbers_combo", "product_numbers_combo" is never populated with any values.

Can anyone help?

View 5 Replies View Related

Updating Several Tables At Once From A Form Based On A Query

Jan 8, 2006

Hi,
I've spend ages reviewing the relationships between my tables and changing my query but cannot get this to work. I've read alot of the posts on the subject also but trying to apply the suggestions to my problem hasn't worked.

It is a database of engineering drawings. A drawing can have one or more revisions. I have written code to import the drawing and revision info into the datebase so when the drawings are actually received I need to be able to add the additional data in tblReceivedDrawings such as the tracking number, date received etc.
These are my tables:

tblDrawingRegister
DrawingNum (PK)
DrawingName

tblDrawingRevisions
DrawingNum (PK)
Rev(PK)
LatestIssueDate
ElectronicCopy
OrderNum
DrawingStatus

tblReceivedDrawings
DrawingID (PK) auto-num
DrawingNum
DrawingRev
DateReceived
ActionCode
TrackingNum

I have created a query called qSelDrawingsAndRevisions which combines tblDrawingRegister and tblDrawingRevisions.

The form is based on a query called qSelIncomingDrawings. This query joins qSelDrawingsAndRevisions and tblReceivedDrawings. It shows all the records from qSelDrawingsAndRevisions and related records from tblReceivedDrawings and is joined on the drawingNum and Rev.

Adding the extra info e.g. tracking num, date received etc about drawings that are in tblDrawingsRegister works fine. However if I want to add a completly new drawing I get an error message:
"The Microsoft Jet database engine cannot find a record in the table 'tblDrawingsRegister' with key matching field(s) 'qSelDrawingsAndRevisions.DrawingNum'

How can I get it to update the drawingNum in tblDrawingRevisions and tblDrawingsRegister at the same time?
Is it an issue with my query or relationships?
Or do I need to write an OnUpdate procedure for the DrawingNum textbox so that it created a new record in the DrawingsRegister table to correspond with the one in the DrawingsRevisions table?
I have a feeling that this might be overcomplicating it and that I just need to change the query?

Am very confused about how to approach this and would really appreciate a few pointers...

View 12 Replies View Related

Pop Message In Form Based On Query Results

Jan 12, 2006

G'Day:

I have tried numerous things to try and create a pop up message or form to alert users of a timing conflict in a scheduling program.
I am not real familiar with codes and am not sure how to handle this.

I used Jason Browne's web site to help me construct a query that will list a result of time conflicts (ie some project is scheduled to occur before another one is completed).
What I need to have happen is the alert message or form opens when this conflict occurs but does nothing when the timing is ok.

I am not very familiar with code and am having a road block mentally. All help is appreciated!

THANKS

View 3 Replies View Related

Two-table Query-Based Form Won't Allow Edits

Oct 2, 2006

Have the data settings for the form all allow=true
And tried the VBA allowedits=true on form open but the form is still locked.
Any suggestions about why?
Is updating two tables from a two-table query not allowed or???
Thanks,

View 1 Replies View Related

Updating Information In A Form Based On Query

Apr 29, 2005

Hello

I have made a form based on a query that pulls information from 4-5 tables. I would like to be able to change information in those 4-5 tables by using that form, but I am unable to do it. I opened up the properties for the form and set "data entry" and "Allow edits" and "allow additions" and "allow subtractions" all to YES. That didn't help.

Is it possible to do this, since the form is based on a query? I couldn't figure out a good way to set up the form getting the information directly from the four tables. I'm not sure why it's been so difficult.

I have one table full of all of the various titles I have. The tables are related using those titles, and each table has a different sort of information for each record. So, the "main" table is "ALL TITLES," but when I go make a form, I can't get ALL TITLES to be the controlling table. It's very frustrating. But a query works beautifully--I just can't change anything.

(I would like to have the form be a "user-friendly" way for people to make changes.)

Thanks for your help.

-Siena

View 2 Replies View Related

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

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

Query For Populating A Form Based On Different Select Criteria

Feb 20, 2006

Hi all,
I have a query which populates a form called EditPatientFrm, which asks the user to enter the patient UniqueID in order to pull up the record they want to edit from the TblPatient. However, I want the user to now be able to input just one of three criteria in order to pull up the record to be edited:

UniqueID
ChartNumber
PatientLastName and PatientFirstName (two fields)

since they may not have the UniqueID readily available to them.

Can anyone show me how to do this? I have tried to find answer to this one under queries and forms- no avail. Sure it's a simple thing...

thanks!
vrpres

View 1 Replies View Related







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