my problem is, I have a form with a sub-form that displays results of a certain query. Now, on the main form I have buttons that manipulate this query.
What I want is, after the SQL of this query has been changed, the sub-form to show updated query results based on the changed SQL. When I close and re-open the form, the sub-form shows the most recent query results, but I want this without having to close and re-open the form, how?
In the VBA code, I already the "Requery" method of the sub-form but I guess I need to do something with the querydef object, too....
Alright, i'm almost sure this isn't the best way of doing this,
But i wanna build a scoring system out of three criteria. cost, delivery, and qaulity. I have those tables built along with a contact table where there over all score will be tallied up. Each contact can have more than one entry in the criteria.
So what I did was i built a query to make a new table for each contact to generate the score and the contact id, then using that ID, i update it to the contact table using the UPDATE function...however wheni have 3 criteria, and 400 contacts..this obviously becomes painfully slow.
The question is, is there a way to directly pull the sql query results (summing the total of each contacts score for each criteria), then storing it into the contact table without making a new table in the process?
I run a physical therapy office and patients come in for treatment either 3, 4 or 5 times per week. My database is used to track these frequencies (among other things).
I have 3 queries which count how many patients come in 5, 4 and 3 times/week.
In my main table I have fields called "how many 5's", "how many 4's" and "how many 3's".
I have tried to design an update query which will update those fileds in my main table to reflect the counts in the 3 queries mentioned above.
(I'm not using SQL view, I'm using the query design view)
In the "update to:" row, I use the Build function and locate the count I'm looking for.
Problem: when I run the query I get the error: Operation must use an updateable query.
I created a main form containing list boxes and a subform. What I want to do is to select items in the list boxes. Then, by clicking "Search" button, the data filtered by the selected items will be shown in the subform. But the subform cannot work and show the query results. I think I miss some VBA codes.
Let's say Table (T1) has fields F1 and F2. After a massive update to T1, there are some records with F1 = "" because a Dlookup using F2 as criteria to another Table (T2) resulted in a null. I created a select query to show unique T1F2 values where T1F1 = "". The user can use this query to find out which F2 values need to be added to T2.
How do I create an update query that will update T1F1 with values from T2 using the T1F2 results from the select query to again use the Dlookup to T2 (of course after T2 has been updated to contain the missing F2's)?
I used to queries ,1 to get items that are taken ( its all about sign in sign out for equipment) and other query is list of all items. How can i make 3rd query which will give me all but taken items from query1? (of course items from query 1 are in query2) thx in advance
Here's my problem. I need to generate a report that says how much of each individual product was produced and as well as the total produced for a specified category in a time period. Something like the following:
I currently have a query that queries a database and pulls out all products that were produced in a specified period and the categories they belong to and dump them into a local access table. Now what I need to do is search through the query results and count up how many of each product were produced (02 AA, 01 AB, etc...) and the totals for each category. The number of categories is pretty limited (6), but there are hundreds of product codes, so I need a way to do this without having to type in each induvidual product code as the requirement by which the query searches. Also, the product codes that get returned are different every day.
I was thinking something along the lines of take the product code of the first row and check for any others in the results that match and write that into another table. Then move onto row 2 and use its product code as a search parameter and search through the query results for any matches. Then continue that until the end of the query results. Can I do that? Is there a better way to achieve what I need?
I have got a query that updates details from one table2 to table1, "Reference" is the primary key and this is what the query uses to determine which need updating.
It all works great but if table2 contains a record in "Reference" that is not in table1 i just want it to ignore it, currently it just seeems to add them.
Ok, i have a question about update queries.I have two tables (I'll call table 1 and table two for simplicity) and an update query. I want to get some data from table one to table two (via an update query). But in table two there is a field that isn't in table one but i want to add a value to that field via the query.My question is, can i manually put into the query what data to add to a field instead of/aswell as using data from other tables.I hope you understood my questions.Cheers
I am trying to filter a form to show the entire weekend's activity on Monday but only yesterday's activity Tuesday through Friday. Using this code I can return Friday's results on Monday and yesterday's for the rest. How do I get the range Friday to Sunday?
I have a query that displays results in a form, but if the query is null, I want to display a different form, or just an error message that says something like "your query returned no results" (right now it will display the form with no fields)
I am a beginning Access/VBA user and have searched and browsed the forum for combinations of null/query/form, but haven't found what I need. Can anyone point me in the right direction?
I am wanting my query results to appear in my main form so that i can edit them, rather than a table the query is just a look up of my form that stores about 500 records and stores all the same fields
Is there a way to write one query that will work for different criteria and is run by different buttons to produce bar graphs or a basic report depending on the button the user clicks??
I am working on a query but can manage to get it to do what I want. I have a main table with a job_ID and a faults table which documents faults that occur related to that Job_ID the tables are related with a one to many relationship. I want the query to bring up all the jobs even those with no faults, at present it is only bring up those jobs that have faults, how do I include details of all the jobs and if there are no faults then that field is left blank, probably very simple to do but after working on this db for hours my brain is no longer functioning!! :eek:
I have a table called tblODF and within that table, I have these fields: - ODFNumber - ODFScanDate - Status (Combo box: Pending, Complete, Licensing) - LastFollowup
In my query, I have the same fields, except I added a calculated field. I added DayCount to
Codecalculate:(Date()-[ODFScanDate]
This should calculate the number we've had the ODF.
What I want to happen is, let's say the status is Maturity, I want the DayCount to say 0. If it's pending, I want it to calculate the actual days.
I've just started using Access 2007, but I've been an Access 2003 user for some years and have a couple of databases, both of which I've now brought over to 2007.
Something I've noticed and is probably very simple. In 2007, after I entered information in a table via one of my forms, I queried on that information but it wasn't included in the results. But everything else - from 2003 - was. I then went thru each field in the underlying table to "match" fields there were filled in for a 2003 record and now the new entry does appear in the query results.
This hadn't happened before in 2003 - it didn't matter if all or even particular fields were filled in. But now it needs for at least some particular fields to be filled in. Don't know if it's something different in 2007, or probably coincidental. I haven't changed anything in the table, query or entry form.
It's not a crisis (now that I see my results), but I'm wondering what is going on - now, that apparently wasn't occurring before?
I hope I can explain this clearly. I'd be really grateful if anyone could help.
I need to set up some sort of contacts database at work.
I need (I think, after having a little think about it) one table, filled with people, (their names, contact details ect) and basically various queries to pull up people in certain groups. Say for instance, people who attend meeting a, b, c, (in a simplised, condensed version of the truth)
I did think about doing this with various tables actually. A contacts table, a meetings table, blah blah, but anyway. (Any advice on this incidentally would be great).
My main problem though. We often have to email all the people who attend say meeting a. We have contacts on our email systems, but they're different from person to person, and as the company is updating email systems, we can't even send contacts lists to everyone, as they're not compatible.
What I'd love is to be able to call up a list of people attending meeting a from my database and email each of those people (their contact details would include email address of course)
:( I have such problem : my query works right, but in ComboBox I got results with wrong sort. Query results is: Street 8 Street 8a Street 10 Street 10/12
But in ComboBox data views such: Street 10/12 Street 10 Street 8a Street 8
I have a query with two table's in them. One is filled, the other is still empty. Both table's are related to each other with the field "document number".
This was working fine in access 2000, now in 2003 it returns zero results. I am starting to think it is because one table is empty it returns nothing. How can i adapt the query criteria or something else that it shows the results from table one, while table two can still be empty. One table holds the documents and all information about it, the other holds the information wich document is referenced on wich document. Now since i can have documens which don't reference to a document, i still want those in the list.
I know SQL, and I know databases, but this has me confrused.
I describe it in terms of macros, but I get the same results if I manually execute the queries.
A client has an Access DB that is used by the 5 employees in the office. He has a macro that creates an interim user list, then compares it the the user list from the start of the month.
If he runs the macro to create the interim user list from his computer (computer 1) then any computer can run the other macro and get the differences (about 200 rows).
If any other computer creates the interim user list, then any computer that runs the macro to calculate differences gets invalid results (>3000 rows).
A union of the 'good' interim user list and 'bad' interim user list shows about 3000 rows (out of 4345 rows in each original table), so the macro produces 1345 differenct rows, depending which computer it is on.
I verified that each computer is opening the correct database, and the query is a moderately simple INSERT INTO ... SELECT FROM query.
Does anyone know why this might happen, and/or an easy way to determine which rows are different, and why? It is Access 2003 with SP1, everyone has the same version.
Does anyone know how to do a query so that the user can find all the things that will expiry at the end of the current month? The user will click on a command button and it will show the results of a product that will expiry at the end of a current month. Have tried with parameters to which the user manually types the end date in and then it will show the results but having problems. Cheers
hi, I've got a problem with multiple rows that I want flattened into one row.
In the attached database, I've created a simplified version of my problem.
The database has two tables, TestItems and Results. In Results, there are four Result columns, representing results of different types of tests.
The two tables are linked on ItemID.
For each record in Results, only one result column will have a value, the others will be NULL. And there is only one result of each type for each test item ID.
The "Test Results" query returns all results, with a separate row for each Result record. For example:
All well and good. BUT, I need the results collapsed into one row so that I get all results for each test item on a single row: ItemID ItemNameResultType1ResultType2ResultType3ResultType4 1 antelope133yes