Record Results Problem
Feb 9, 2006
Front End: MS Access
Back End: SQL Server
I currently have a client record database. The most important tables are the client and order tables which are joined via 'clientID'. I have built a search system which displays the results in a subform below the search criteria. The problem is that if a client has more than one order the results show multiple instances of their record...
My plan is to have a 'view selection' button which will then open the form with this selection (minus duplicates).
I was thinking about doing this in one of two ways:
1) Take the client id's from the subform and build them into an IN( insert CSV client ID's here) then open the form with this filter... or
2) Try to remove duplicate records from my result set somehow...
My problem is I have no idea how to do either... I can give example or screenshots if needed. This is the last part of the database and so any help appreciated.
Phil
View Replies
ADVERTISEMENT
May 1, 2008
I'm currently trying to create a KPI report (Key Performance Indicator) to log jobs & their response times
I can easily produce a query that gathers all the information needed but I need to find a way to limit the results to 1 record per job as one job can have many records - Primary key being the TaskID field
I need a way to only pick out the oldest record & ignore the rest
For example
A priority 1 job that was logged at 01/05/2008 08:00 that needs to be responded to within 2 hours
Two engineers have carried out the work & logged the following details
1st Engineer responded at 01/05/2008 09:00 and the other returned later to complete the job at 01/05/2008 13:45
I need the query to only pick out the entry for 01/05/2008 09:00 as it's the oldest.
Any suggestions would be most welcome
this is what my query looks like at the moment.
SELECT tblTasks.TaskID, tblTasks.DateReported, DateAdd("h",DLookUp("[ResponceTime]","[tblPriorities]","[tblPriorities]![PrID]=" & [PrID]),[DateReported]) AS DueBY, tblTaskTime.TTStarted AS DateStarted, tblPriorities.Priority, tblPriorities.ResponceTime, [DateStarted]-[DateReported] AS Responded
FROM tblBuildings INNER JOIN (tblContracts INNER JOIN (tblPriorities INNER JOIN (tblTasks INNER JOIN tblTaskTime ON tblTasks.TaskID = tblTaskTime.TTLINKTask) ON tblPriorities.PrID = tblTasks.TaskPriority) ON tblContracts.ContID = tblTasks.ContractNo) ON tblBuildings.ProID = tblTasks.BuildingID
WHERE (((tblPriorities.Priority) Not Like "P8*" And (tblPriorities.Priority) Not Like "P5*" And (tblPriorities.Priority) Not Like "P3*" And (tblPriorities.Priority) Not Like "P6*"))
ORDER BY tblTaskTime.TTStarted;
Thanks
View 10 Replies
View Related
Oct 19, 2005
Hi All
I'm currently working on a product catalogue, i have a product data screen (frmProductLookup) one of the field s i have is "Replacement" for when a product is superseeded. What i want to achieve is to be able to click on a button and open a second product data screen that automatically goes to the record for the replacement product.
I've currently tried creating a duplicate data form (frmProductLookup2) and used the openform wizard, but for some reason this pulls up a blank record...any ideas
cheers.
View 3 Replies
View Related
Dec 5, 2013
Is there a way to search for a term within a form and goto a record that matches that term assuming there was only one matching result (Unique ID, for example).
But NOT filter the results so that user can still navigate as usual after the search has been carried out.
View 1 Replies
View Related
Dec 24, 2013
I have two unbound subforms on an unbound "display form". I managed to link the two subforms by following this method: [URL] This is great and works well enough, however, by design, subform2 will only display records relevant to the very first record on subform1. I need subform2 to be filtered based on ALL of the relevant records being displayed in subform1 not just the first one.
Previously, subform2 was based on a query using subform1's records as criteria, but this gave me the same result.
View 14 Replies
View Related
Jul 11, 2013
I have a field called density which needs to be updated to show either 10, 20, 30, 40, 50,60, 70 or 80 depending on a number of variables, for example: If market location is 'hot' and unit type is 'house' and discounted is 'no' then show '10' in the density box.
or perhaps:
If market location is 'cold' and unit type is 'apartment' and discounted is 'no' then show '20' in the density box.
I have tried all sorts of expressions and queries but have really reached the limit of my know how and can't solve it. Is it even possible to do this in Access?
View 2 Replies
View Related
Nov 13, 2013
I am relearning Access and having a little difficulty. I am creating a Access database that links tables from an I series system which I have done trouble free. In the database I have pulled up for example a patient demographic file (hospital). I have form frmSearch that prompts the user to enter the medical record number OR they can search by name. I have a query that takes that information then loads a 2nd form to display the query results in a list box. I would like to be able to click on one of the results from the 2nd form to then load another form that will display all of the patient information that was selected.How do you set this up so that with the results shown, I can click on one of them and it will load that patient into another form pulling the rest of his or her information from the table file?
View 12 Replies
View Related
Jun 2, 2015
Is it possible to once you have run a query be able to somehow double click on the results in order to either go to original record or see more details? Similar to "show details" in excel?
I have made some queries that are working well however they are specific in nature and once found display a list of results. I have left a field that uniquely identify them and are after a quick way to view the details of the results from the query rather than take the ID# and manually search the original table.
View 8 Replies
View Related
May 3, 2015
I have a table, with a related value in another table. E.g. A Items table with a batch value from another table.
I have a form to enter how many of these items has been used and from which batch number they belong.
The batch number is from a dropdown, and batches can be finished(exhausted) and marked such in the table so they no more show in the dropdown.
All this works fine, until, I go back to a entry which was from a batch that has been finished. The combobox is empty although the (Already finished) batch number is mentioned in the table. This is perfectly normal as my query for the combobox is :
Code:
SELECT ItemBatch.ItemId, ItemBatch.ItemBatchNumber, ItemBatch.Finished, ItemBatch.ItemName
FROM ItemBatch
WHERE (((ItemBatch.Finished)=False)
AND ((ItemBatch.ItemName)=[Forms]![ItemMasterForm]![ItemDataSheet].[Form]![ItemName]));
What I want is to show the current batch number as well. I tried to make this query get the current value, but wasn't successful. I tried to make a calculated field based on the dropdown and show its value.
Is there any way I can show the batch number in the datasheet? I have to use a datasheet and not a form, because there will be many sub records for the main form, and having a form will be very uneasy.
View 3 Replies
View Related
Sep 1, 2013
I have one table (500 Club) with two fields (ID) (Name) i would like to randomly pick a record from the table and display the results in two seperate text boxes on a form one for (ID) and one for (Name). I intend to use this for a monthly draw at my workplace.
View 6 Replies
View Related
Nov 14, 2007
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?
IIf(DatePart("w",Now())=2,Date()-3,Date()-1)
Using >Date()-3 doesn't work.
Thanks
Bruce
View 5 Replies
View Related
Apr 29, 2014
I have built a custom search form in a MS Access 2010 database so that users can find specific records to edit. After entering the search criteria and hitting a Search button, another form opens up that shows the search results. This second form includes a command button for generating a report of the search results.
Right now, the custom search form and the search results form are both working properly, but the search results report is showing every record in the database instead of just the search results. This is true whether I access the report via the command button in the form or the navigation pane. I'm not sure if I need to correct my VBA code or the report's properties.
View 4 Replies
View Related
Apr 1, 2008
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
View 7 Replies
View Related
May 12, 2005
How can I pull the last two values, grouping by property id, so I can compare them? I can use Max to get the last value but not sure how to get the previous one too!
View 1 Replies
View Related
Apr 27, 2006
This may be a simple problem, but I cannot find the solution myself.
I need to design a query based on a table describing all sales during a year to a number of clients of my company.
However , even if 50 sales may have been made during the year to some clients, I want the query to return only the top 3 sales for each client.
Any suggestions
Thanks
View 6 Replies
View Related
Aug 29, 2007
Hi Guys I'm not really sure wether this should be in queries or forms (as not sure where the code needs to go) but heres the problem. i have a front end form (where the user has various drop down boxes to choose from) which then runs a query and outputs the results in another form.
At the moment when there are no results it just brings up a big grey empty box, which is annoying since I want to use custom close buttons and disable the red x. Is there any way that if there are no results the query could open a different form (where I'd put some kind of error message and navigation choices).
Any help would be appreciated.
View 3 Replies
View Related
Jul 5, 2005
Hi All,
I made a form with a specific field. If I enter a value into this field it automatically runs a query. The results are shown in another form. However if I return to the previous form and enter the same (or another) value it still runs the query but this time with no results? I think it is a memory problem. The previous form is closing.
Does anyone have the answer to this one?
Thanks
View 2 Replies
View Related
Aug 9, 2006
I'm trying to run an SQL statement to Sum the values of a table column. No problem. It would be useful for me to take that total and be able to set it equal to a variable within my VB code that's running, I just don't know how to do that, I'm very new to VB programming.
I cannot find help anywhere on the internet for this. :( I'd like to do something like this, just don't know how:
VariableName = Run.SQL ("Sum(tblName.Column) AS SumOfColumn FROM tblName")
I'm not a programmer by trade, so I am picking up things piece by piece, and just cannot find my way out of this task. Thanks for your help guys.
View 1 Replies
View Related
Feb 8, 2006
I'm doing a table for Future Business Leaders of America competitive events assignments.
I want the same table to hold Name and Event Name and be able to sort
However, I want the database to be able to sort to tell me each event that a person has, and at the same time, how many people are in each event. Presently, I have to switch between databases.
On one table, the event name is the primary key, and on the other the person's name is the primary key.
For the event name table, categories are "Event Name" , "Participant 1" , "Participant 2", "participant 3", etc.
For the Person's name table, Categories are "Name", "event 1" , "event 2", "event 3", etc.
I want to have ONE database that will sort lists for all participants in each event AND that will sort into a report or form so that I can inform participants of their events.
How can I do this?
I probably was not very clear, so ask lots of questions if you're unsure.
THANKS A LOT!!
View 4 Replies
View Related
Jul 4, 2005
Im having a real problem in creating a query to return the results that I'm after. I have a wargaming Database. Units are created on seperate forms i.e Armour, Infantry etc. There could be a number of Battalions of each say Armour1, Armour2, Infantry1 Infantry2, the amount is endless. All of these battalions are linked to a game name i.e Battle 1, Battle 2 etc.
Im trying to show in a seperate table the name of each battlion that is involved. At present whaen I create my query I use the Arour Table and the Infantry table but if Ive only created 1 Armour unit and 2 Infantry unit, it shows the record twice. ie:
Battle 1 Armour 1 Infantry 1
Battle 1 Armour 1 Infantry 2
I Want Battle 1 Armour 1 Infantry 1 Infantry 2
Any ideas, a bad explanation I know but hopefully you understand!
View 1 Replies
View Related
Nov 30, 2005
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
any help would be appreciated
thanks
View 1 Replies
View Related
Jan 27, 2006
Greetings all,
Below is a query were I can get eveything into tow columns but I would like to have the results in one column?
SELECT tbl_Admin_Company_Details.Companyname, tbl_Admin_Company_Details_1.Companyname
FROM tbl_Data_JobOrder INNER JOIN tbl_Admin_Company_Details ON tbl_Data_JobOrder.CompanyID = tbl_Admin_Company_Details.CompanyNumber, tbl_Admin_Company_Details AS tbl_Admin_Company_Details_1 INNER JOIN tbl_Data_Receival ON tbl_Admin_Company_Details_1.CompanyNumber = tbl_Data_Receival.OwnerID
GROUP BY tbl_Admin_Company_Details.Companyname, tbl_Admin_Company_Details_1.Companyname;
The Results are;
tbl_Admin_Company_Details.Companynametbl_Admin_Company_Details_1.Companyname
Company 1Company 1
Company 3Company 2
What I would like is something like
Company 1
Company 3
Company 2
Thanks in advance
rgmb
View 2 Replies
View Related
May 31, 2006
Hi,
Is it possible to change the resulting format of a new field (expression) within a query?
I.e. Instead of the resulting when running query being displayed results in decimal places but instead being displayed in percentages
Regards
View 3 Replies
View Related
Jul 5, 2006
I'm trying to run a query that has a 3 expressions within the query. I'm using the following:
Exp2-Exp1 this would be the results for Exp3.
The problem I am having is that I only need the results for Exp3 to be returned if they equal "0".
Any help would be appreciated.....Thanks
View 2 Replies
View Related
Aug 15, 2006
I have this table
AircratfID
Flight
Time
I have a aircraft logbook with 4 entries for page
I tried to build a query that shows
"Time until this page"
"flight time"
"flight time"
"flight time"
"flight time"
"Time to copy to next page"
Anyone? Thanks
View 3 Replies
View Related
Mar 6, 2007
I've created a database to keep track of all our Microsoft licences for the company.
Just to make sure we're fully licenced, to allocate where needed, and to help reallocate when we replace a pc.
I have 2 tables, 1 hardware (listing PC ID,location etc.) and 1 software (listing software type, software licences, and to which PC ID allocated).
What i'm trying to do is filter the pc's missing either an Office licence or a Windows licence or both, so i can base a report on the results.
I've tried but can't quite get it to work.
Any help would be greatly appreciated.
View 3 Replies
View Related