I've been trying to solve this problem for almost a full day now and i'm starting to get desperate.
Can't seem to find any help on the net, so i hope maybe one of you will be able to save me.
I have 2 list boxes :
1. MainBox - shows a list of records from one table.
2. FilterBox - this is actually a query that shows a list of records from another table, filtered by the record i choose in the MainBox.
I added the MainBox a custom line displaying "All" by adding this code to its RowSource :
UNION SELECT "(All)" from MainTbl
So now i see the list of records like before, with a "(All)" as the 1st line.
Now i want to set up the FilterBox query so that if i select the "(All)" line, it will not filter the table and just show me all records, so i entered this code as the appropriate column condition :
IIf(([Forms]![frmTest]![MainBox])="(All)",([tblFilter]![FilterColumn]) Is Not Null,[Forms]![frmTest]![MainBox])
That's supposed to check if i have selected the "(All)" line in the MainBox.
If i didn't - then the FilterBox gets filtered by the MainBox value - this is working fine.
If i did - then the column filter value should become "Is Not Null" which, according to my understanding, means that the column won't get filtered - that's not working! When i select the "(All)" line, i just don't get any records in the FilterBox.
Does anyone have any idea what i can do to fix this ?
Sorry for the long explanation.
Thank you very much!
I cant make work, a query with creteria filled within controls of a form. I will be more specific to make u understand what i want to ask. There are 2 text fields and 2 combo boxes. All of them call a report (by pressing a button) from the main table. in the "totalquery" query i call each control this way:
select tblPeople.name,tblPeople.tel,tblPeople.age,tblPeop le.Car from tblPeople where tblPeople.Name=[forms]![frmMyform]![combo1] OR tblPeople.tel=[forms]![frmMyform]![text1field] OR tblPeople.age=[forms]![frmMyform]![text2field] OR tblPeople.Car=[forms]![frmMyform]![combo2] GROUP BY tblPeople.name,tblPeople.tel,tblPeople.age,tblPeop le.Car;
I want to make it display (the right) results if one of the text filed/combo is filled or with data, or all together or in combinations. i use the OR statement,but it doesnt work if I fill in two fields/combos together and etc. Anyone? :rolleyes:
In my access form I provide the user a list of locations from various countries in a listbox . But the list is too long so I provide him a combobox for selecting a country. Selecting the country should update the listbox showing only the locations in that specific country.
So my SELECT from the listbox must cover the unselected state and show all entries and when a country is selected it must narrow the selection.
I tried to get this happen with the following SELECT statement containing a variable. Choosing a country in the Combobox results in a change of the variable and in a requery. This works after the first country is selected and for each country change, but the initial list is empty.
VBA in the loadform 'Application.TempVars.Add "varcountryselect", "*" SELECT in the listbox "lstlocationsperproject" SELECT tbllocations.locationID, tbllocations.country, tbllocations.localstreet, tbllocations.localcity FROM tbllocations WHERE ((tbllocations.country) Like [TempVar]![varcountryselect]);
VBA in the combobox Application.TempVars("varcountryselect") = [Form]![kombcountryselect].Column(0) Me.lstlocationsperproject.Requery
The values in [kombcountryselect].Column(0) are texts like "SPAIN", "MEXICO", etc.
Any hints, how I have to use the * for getting the complete list on the initial view ?
I have a query in my database, and I have recently added new possible entries for area. My report tells me how many male chickens vs. how many female chickens I have. Now with the new entries for area, I want my breakdown to EXCLUDE any chickens that live in a specific area.
For instance:
Pen A has 15 males & 15 females. Pen B has 12 Males & 13 Females. Pen C has 50 males & 50 females.
Pen C is the recent addition...
Right now my report shows: 77 Males & 78 Females...
I WANT it to EXCLUDE Pen C, so it would report: 27 Males & 28 Females.
Can anyone tell me how best to do this? I figured I would add a custom field to the query that the criteria for is "Pen = C" and then on my report I would change the data source from: =Count([Chicken Query]![Male] --- and make it =Count([Chicken Query]![Male] - Count([Pen="C"]) --- or something like that.
Can anyone help me? And if so could you help with the proper code for the second part that I am adding new? I know the Count([Pen="C"]) isn't right, but until I know exactly how to add a custom field to the current query, with the critieria of Pen="C", I don't know how to write the -Count([NewField]) code, if that would even work.
I am looking to check, whether i would be able to "add an Message box with a "Message : "Executes all queries all is well.mdb before executing this query ?" , if yes, continue executing the query, else, Exit out of the database?
Hello, I have created a crosstab query where I specify the order of Column Headings, however, I can't figure out how to specify the order of Row Headings. I only see that Microsoft Access offers the option to sort ascending vs. descending. I'd like to customize my sort order such as "Under 18" row first followed by "18-29" row and then "30-39" etc.
I have made a function returning True/False values. I used this function in a query and now it return value Error as well...Is there a way to set criteria to values received in that field (0/-1/#Error). I've tried putting Like 0, Like True with or without quotation mark.Also every workaround comes into play as long as it works.
I am trying to create a query to find duplicates and delete the duplicates. The result will eventually be used in another query (append query) to update a table.I have a table with 4 columns lets say for simplicity they are A, B, C, D
I want my query to find duplicates within B and deleting them. The catch is before deleting them I need to look into column A to ebsure they are actually duplicates. Example below
Example A B John Doe Tires John Doe Wipers Allison Doe Tires Allison Doe Tires
As you can see from the above Tires is a duplicate and need to be deleted.
A B John Doe Tires John Doe Wipers Allison Doe Tires
Database query. I need the query to count the records of a field and display a number for the records of the field. For instance, one field is [Genre] and the other is [Show]. The query needs to list the Genres along with the number of shows for each genre. I've been able to just use the query design and add the genre field and I can add the show field, use totals count which gives me the genre counts the number of shows. My problem is the null. Some genres don't have a show listed so the genre doesn't even show up in the result. If I could get the the genres that have null shows to result a 0 it would be perfect.
I have made a database for work and is fully functional, but theres one thing I want to add but cant get my head around how to do it.
I have created a Form called 'Filtered Search', on the form it has multiple combo boxes for 'Auditors' 'Area' 'Status' and 2 text boxes for date range.
I want to be able to set what filters I want, and for the query to ignore any fields with no information selected/inputted (i.e. I want to see all records raised by "Mr Smith" (Auditor) that are still 'Active' (Status) in all areas at any time).
Names of items;
Table = 'Incidents' Form = 'Filtered Search' Report = 'Filtered Report' Auditor = 'Combo7' Status = 'Combo156' Area = 'Combo5' Date Range From = 'Text161' Date Range To = 'Text163'
I have generated a standard form for displaying/editing of data and I have also created a form for generating Sql query statements (The form builds a string but does not execute the query). Can I execute a query and use it with that form.
So when I generate the the SQL statement and execute the query it loads the form (With Data) instead of a query datasheet. Thank you.
I'm trying to track daily production at a manufacturing company running many different processes at different locations each running multiple parallel "lines." The tricky part is that the number of lines running and the shift schedules e.g. 2shifts 10hrs/day 4days/week or 3shifts 8hrs/day 5days/week change frequently for each process.
Right now I have a form for process data that specifies the schedule and number of lines running each day. Then I'm running an append query to a "production" table that generates blank production records associated with each item made in each process for the correct shift/line combinations.
Up to now I've been manually changing the date on the append query each time I run it. Then I have a seperate query for each process that pulls out the production records for each day. My problem is that the preferred interface for production data entry is a spreadsheet with the following layout:
--------DAYS LINE 1 DAYS LINE 2 SWING LINE 1 SWING LINE 2 ITEM 1 100 ITEM 2 2250 ITEM 3
which changes each time the shift/line schedule changes for each process. The only way to achieve this layout I know of is a crosstab query which isn't updateable. Ideally, each day the manager will specify the shift schedules and forms will be automatically generated with the correct structure and sent to the process supervisors. I'm open to different form layouts and even redesigning the database completely.
I have a DB where you there's 5 tables all linked together by one project ID
tables below
Project , Staff, Asset, allowances, travel, mark up
What I can do is create a new project, then add records to each of the other tables on what different items I require,
i.e. I create a new project - called project one, in the project table I create a record stating, name, time scale, client and location, then I add different records to each of the other tables on what I require all linked to the same project ID. (probably not explained that too well)
Now I want to create a query that lists all the requirements one after the other this will make it easier to create reports and to calculate costing's.
At the moment I have made 5 different queries listing all the data, then have one report containing 5 sub reports to display the data, no this does work.
I have created a database showing the results for a number of events with long and complicated names.
In the database is a query which select the first, second and third for each event, I would like to have it show each event seperately unfortunatly the number of events is to large to create a seperate query and report for each one.
Is it possible to have a parameter query asking for the event name where instead of the user just entering the name of the event, can they pick the event from a dropdown list?
Ok, let me preface this with I'm a newbie at Access, and I'm currently using Access 2003. I'm just hoping someone can point me in the right direction. Right now I have multiple tables with set data in them that doesn't change linked to another table where I have a drop down menu (combo box I think it's called in Access) to easily select the given data from. I want to have a drop down box (combo box) to have a set of given variables I have in a table to put in the search criteria. That way a user doesn't have to type the exact criteria into a query. That way I can easily put in the variables I want to search from in the query with less chance of an error. I'm hoping this is possible.
Ideally if I could get help in how to make a form that would allow me to have the set of columns from the corresponding tables with combo boxes to select from and then be able to have a "subimt" button and have it organize the selected results into that form as well.
I have a table with records Name1, Name2, through Name6 I need to have a query or something that will join all theese records under one list. :confused:
Currenlty, when I click on my query and have it begin ... I have it set up where I then enter three seperate pieces of distinct data so that the exact information I'm in need of, which is stored in 2 seperate tables, can then be pulled together and displayed into one final combined table ...
I'd like to modify this beginning point where ... once I click on the query to begin, I can then just choose from a Drop Down list which has all the various rows of information displayed via these 3 unique indentifiers ... I then just scroll through and pick what I need and it then populates the final combined table as before ...
How do I add the drop down effect at the start of the query?
Hi, Anyone got any ideas how I can create a query that runs from the selection in a list box. What I need to do is when the user selects an option in the List box for them to select a button to the right which acknowledges the secletion and then runs a query with the selection as the criteria.
I have a query which is based off all fields of the main table. I want to run the query based on one or more choices made from a list box on one field: category.
tbl_ClientMain
qry_ClientCategory - all fields of tbl_ClientMain with criteria under Category as =[Forms]![frm_CategoryList]![lstCategory]));
frm_CategoryList is a listbox form based on qry_Category
qry_Category is a group by query from tbl_ClientMain of the Category(s) collected
When I run the query, I get Enter Parameter Value: Forms![frm_CategoryList]![lstCategory]));
Based on what I've read in various postings and other sources - I must be close, but I'm missing something. Any ideas?
Please help, I have a form with 7 option buttions and a calendar. i would like to be able to run a query from the selection that is made. the way this would work is: 7 option buttions - listing different locations Calendar - select date the query would list any event and the start time and end time that fell on that date. my problem is that I dont know were to start. i have been told to use SQl statements. i have tried this but only failed miserably. the events and times are in 2 different tables, i cant get a SQL stastment to work like that. I have tried to use a List box, using the Row Source to display a query, but only 1 row showed. it still was unselectable. Please help, dont know were to go with.
I have a Select query that lists, among other things, two fields: ID_Clients EndDate
Each entry in ID_Clients may be listed several times
I want to generate a Select query based on the above query that lists each value of ID_Clients just once, by selecting the record for that ID_Clients that has the maximum value in the field EndDate.
I was wondering was it possible to have my queries in a pull down list and I hit a button and the query/report is ran? Or do I have to stay with about 6 or 7 buttons on a form?