Filtering Lookup Value Based On Other Lookup Values
Jul 27, 2015
I have three large source tables imported into my database. I have created queries to retrieve relevant values from fields in each source table which feeds into my form. Each field on my form that is connected to the relevant query is a lookup field. For example, one field called "Supplier_Name" another called "Supplier_Code" and a third called "Route_Number".
Needless to say each of my lookup fields are very long. I am trying to filter my search based upon the selection from the previous Lookup field. How I can filter a lookup field's value based upon the previous lookup field selection? Each Supplier has a code and assign route(s) and I have already established these relationships.
View Replies
ADVERTISEMENT
May 30, 2005
Hi, not sure if this is possible or the most economical approach but here goes:
I have a lookup table (tblHolidays) with a list of holiday dates (fieldname "HolidayDate") in it.
I need an update query that can check all "StartDate" values on a table called "tblMasterLog" and where this date matches the ones on "tblHolidays", will add 1 day to the "StartDate" and then keep repeating until there are no more dates to change.
Can this be done?!
Thanks in advance
View 2 Replies
View Related
Sep 3, 2014
how data is best structured in Access.I have a table of values (for instance: weight) and I need to be able to look up a weight based on the column header (age) and row header (height).How is this sort of data best structured and accessed in Access?
View 12 Replies
View Related
Jul 24, 2007
I'm wrestling with the issues; in other threads, it became apparent that because I could not know ahead of time what I will need to know about a given entity, I will use a table to enumerate attributes that is applicable for a given entity.
However, the stumper is that what if an attribute should conform to a set list of values? Since they are dynamic, I would have problem predicting what I will need to be able to lookup, and am even don't know whether I will need a one-many lookup or many-many lookup.
I thought that generic lookup table with a table listing "classes" of lookup would allow me to have one big generic lookup table while using "classes" to act like virtual tables so I can then set the query to appropriate "class" to return just right set of values.
But as I thought about it, I ran into some issues which is pulling me toward the crazy idea that I should have freestanding tables, and use a field in tblAttribute to give me the table's name so I'd know which free-standing table it points to, and have the necessary key to lookup the values within that table.
Even though my gut instincts tell me that I shouldn't be going against the conventions of database design (who the frick goes around creating free-standing lookups?!?), I'm simply not sure how I can use a generic lookup table to hold all information.
For example, suppose I was given a list of values that has its own categories. Since the former design allows only for two level (lookup and lookupclass), where am I to insert that extra level?
Furthermore, I found myself needing a set of virtual keys to reference a certain "class" of lookups for report purposes. That means I need an extra field in my lookup table than I originally anticipates. What if I find myself needing one more field that just won't fit the generic lookup table?
So does anyone have suggestions on how we would create a placeholder for a lookup table that will be made just in time?
View 4 Replies
View Related
Jul 31, 2006
In an order entry system I have two tables relating to products available: one listing the products (e.g. mugs, pencils, etc), and another listing options. The options table has two fields, one for the product type (e.g. mugs, pencils, etc), and the second has the options (e.g. red, yellow, green).
So, taking mugs as an example, there is one mug record in the products table, and three corresponding records in the second table because there are three different colours available.
I have created a lookup in my Orders table to lookup the product and another to look up the option.
What I now want to do is make the Options lookup only display options which are available for the product type selected.
So, say for example that pencils are standard and without options, then the options lists should not contain any items for the user to select. But, if a mug is the selected product, then the colour options should be in the list of selectable options.
How can I do this?
Gary
View 4 Replies
View Related
Feb 23, 2015
I have a lookup value in a table, and I would like to remove all values of the lookup value from vba. How can i do it via vba? i've been trying to do it in a query but i have always some errors and i can not remove them.
View 2 Replies
View Related
Jun 13, 2006
BACKGROUND
I am desperate to solve this problem but unfortunately I have not been able to figure it out. Below I will outline a design of a database and the desired results.
I know what I want to do but I don’t know how to do it (or whether it is impossible!)
DATABASE DESIGN
The design below is a simplified version of the real thing but it contains the essential information needed to understand my database.
Staff Data
Contains daily data for several members of staff
Staff ID
Staff Name
Date
Data Field 1
Example records:
600-001, Bob Smith, 01/03/2006, 50
600-001, Bob Smith, 02/03/2006, 50
600-001, Bob Smith, 03/03/2006, 50
600-001, Bob Smith, 04/03/2006, 50
600-001, Bob Smith, 05/03/2006, 50
600-002, Jayne Cole, 01/03/2006, 60
600-002, Jayne Cole, 02/03/2006, 60
600-002, Jayne Cole, 03/03/2006, 60
600-002, Jayne Cole, 04/03/2006, 60
600-002, Jayne Cole, 05/03/2006, 60
600-003, Alex Winter, 01/03/2006, 20
600-003, Alex Winter, 02/03/2006, 20
600-003, Alex Winter, 03/03/2006, 20
600-003, Alex Winter, 04/03/2006, 20
600-003, Alex Winter, 05/03/2006, 20
Team Lookup
Shows what team each staff member belongs to and what date this is effective.
Staff ID
Team
Start Date
Example records:
600-001, Sales, 01/01/06
600-002, Sales, 01/01/06
600-003, Accounts, 01/01/06
600-002, Accounts, 04/03/06
Please note:
The first three records show that at the start of the year Bob (600-001) and Jayne (600-002) worked for Sales and that Alex (600-003) worked for Accounts.
The last record shows that from 04/03/06 Jayne switched teams to Accounts
Query Assign Team
Assigns the correct team to Staff ID for each date
Staff ID
Staff Name
Team
Date
Data Field 1
Desired Results:
600-001, Bob Smith, Sales, 01/03/2006, 50
600-001, Bob Smith, Sales, 02/03/2006, 50
600-001, Bob Smith, Sales, 03/03/2006, 50
600-001, Bob Smith, Sales, 04/03/2006, 50
600-001, Bob Smith, Sales, 05/03/2006, 50
600-002, Jayne Cole, Sales, 01/03/2006, 60
600-002, Jayne Cole, Sales, 02/03/2006, 60
600-002, Jayne Cole, Sales, 03/03/2006, 60
600-002, Jayne Cole, Accounts, 04/03/2006, 60
600-002, Jayne Cole, Accounts, 05/03/2006, 60
600-003, Alex Winter, Accounts, 01/03/2006, 20
600-003, Alex Winter, Accounts, 02/03/2006, 20
600-003, Alex Winter, Accounts, 03/03/2006, 20
600-003, Alex Winter, Accounts, 04/03/2006, 20
600-003, Alex Winter, Accounts, 05/03/2006, 20
Query Group By Team
Summarises data by team/date
Team – Group By
Date – Group By
Data Field 1 - Sum
Desired Results:
Sales, 01/03/06, 110
Sales, 02/03/06, 110
Sales, 03/03/06, 110
Sales, 04/03/06, 50
Sales, 05/03/06, 50
Accounts, 01/03/06, 20
Accounts, 02/03/06, 20
Accounts, 03/03/06, 20
Accounts, 04/03/06, 80
Accounts, 05/03/06, 80
PROBLEM: WHAT I AM TRYING TO DO
I don’t know how to get the query “Query Assign Team” to work!!
I would like to lookup up the ‘Staff ID’ and ‘Date’ in “Team Lookup” and return the appropriate value for ‘Team’
If the only two records in Tbl Staff data were:
600-002, Jayne Cole, 03/03/2006, 60
600-002, Jayne Cole, 04/03/2006, 60
I want the query to return:
600-002, Jayne Cole, Sales, 03/03/2006, 60
600-002, Jayne Cole, Accounts, 04/03/2006, 60
Can anybody help me?
Should I be using DLOOKUP? If so, how?
Is VBA the only way around my problem? If so, can you tell me what it is?
Am I attempting the impossible?
View 9 Replies
View Related
Jan 22, 2007
I just started a new database and I'm new at this so I have a question about ID numbers for my two tables.
In Table1, I have faculty demographic information, and a FacultyID (unique ID number created by AutoNumber).
Table2 has the courses those faculty members taught - one faculty teaches many courses. But this table does not have the FacultyID that I added to Table1.
So, how do I automate the process of looking up the FacultyID number from Table1 and adding it to the currently blank FacultyID field in Table2? Theres hundreds of records and this will be done every semester, so I need an automatic way of doing this lookup.
Any help would be appreciated. Thanks.
View 1 Replies
View Related
Mar 2, 2005
Hello,
I wonder if anybody can help me.
I have a table called ITEM, within ITEM I have three fields ITEM NUMBER (Key Field), Item, Cost,
I have another table called INVOICE ITEMS, Within INVOICE ITEMS I have six Fields, INVOICE NUMBER, ITEM NUMBER, ITEM, UNIT COST, Amount, Total Amount.
I want to use Lookup wizard to complete the fields ITEM NUMBER, ITEM, UNIT COST from the ITEM table.
Is this possible?
Regards
Nathan
View 1 Replies
View Related
Dec 13, 2007
I've been racking my brain the last couple of days trying to figure out how to solve this problem, and I believe I've reached the end of my rope. I have a feeling that this isn't very difficult to a more savvy Access person, but I am at a loss.
Here's the situation. I have received a fairly large DB containing CCTV data for sanitary sewers. There are primarily two tables I'm dealing with, one lists a number (auto-number) for each pipe that was televised. Simple enough. The other uses this legacy number to show all deformities or service leads within a particular length of pipe. For example, for run X, there may be 7 rows in the table with X as the ID, one for each service lead along that length of pipe (I hope this is making sense :()
Ultimately, we need to tie this database into our GIS theme. To do this, I will need to add to the PipeID number from our GIS theme to the access table. What I've done so far is to create a new table in the DB with the number for each pipe televised, and I've manually added the corresponding PipeID number from the GIS in the second column. What I'm hoping to do is add a new column to my occurrence table so that for each occurrence X, I can add the GIS PipeID number. Perhaps this would make more sense:
Run # PipeID
1 S143
1 S143
1 S143
1 S143
2 S231
2 S231
2 S231
2 S231
3 S543
3 S543
3 S543
I've gone ahead and created the relationship between the newly created table and the existing table based on that auto-number field, and I've made the new PipeID column a combo box. This shows all of my PipeID numbers, which is a good thing. I'm hoping there's a way for it to automatically recognize the auto-number field and populate the PipeID field accordingly.
Have you ever known what you want to say, but not quite understood how to say it? That's kind of how I feel about this question, and I do apologize if I've made no sense. But if I have, and anyone has any suggestions for me, they would be greatly appreciated.
Cheers,
Azimuth
View 3 Replies
View Related
Nov 16, 2006
I have a small database with 3 tables.
tblBilltoCustomer
Fields - Key - BillCustID , companyname, address1, address2, city, state
tblOrders
tblCustomers
I have a form that has tblCustomers as the main form then tblOrders as a sub form.
I want to place a combo box on the form that will lookup a company name from the tblBilltoCustomer table then brin in the address1, address2, city,state , into the form for that record. But then I need that same info to print on a rpt.
I can get the lookup to work using =cboCompanyName.Column() but the addresses , city and state will not show on report
Is there any good samples of lookup fields
Any Ideas are greatly appreciated
Dean
View 6 Replies
View Related
Feb 12, 2014
II have been working in Access 2010 and by no means would I call myself an expert. I have two different tables, one is called 'JobsList' and the other one is called 'StatHolidays'. On the Jobslist form, I have a field that requires a ship date, however, I don't want to allow the user to select the dates listed in the StatHolidays table. Is there a way that when a user picks a date that is listed in StatHolidays that a pop up box will say "This date is Christmas, do not choose this as a Ship date". The 'StatHolidays' table has a field for a date and for a description of the holiday.
View 7 Replies
View Related
Aug 19, 2011
In the attached Database, I have four tables. The purpose of the Database is to track training for employees. A quick description of each table:
Employees: List of employees requiring training
Course List: List of Courses offered
Course Schedule: When said courses are offered (one to many relationship with Course List). this has a Composite Primary key consisting of the Course Number and Section Number
Course Attendance: This is to track which employees attended which class.
Question 1:
In the Course Attendance table, the first field (SOS Course Number) looks to the Course Schedule table. This field uses a lookup to select the course and section number, but only displays the course number. How do I get it to also display both the course and section number (don't care if it is displayed in one or two columns)?
Question 2:
Similar problem, except the second field is Employee Last Name which is a lookup from the Employee table. I want to display both last and first name in two separate columns.
Note, I realize there are spaces in table and field names. Please ignore this for now. It will be fixed later.
View 1 Replies
View Related
May 12, 2014
I am new to Access and am currently learning it so that I can construct a database of trivia questions.
I have a "Questions" table with question, answer, type, etc. This table is linked to a "Categories" table with a many-to-many relationship using a junction table called "Questions_Categories". The "Categories" table is also linked to a "SubCategories" table with a Categories as the parent and SubCategories as the child. I have attached the database for ease of understanding.
When I enter data into the "Questions" table using datasheet view, I open up a subsheet that shows me the Category and SubCategory fields which have their own lookups.
My problem is the following: I want each category to have its own set of SubCategories. For example, the "Region-Specific" category has "Canada", "London", and "Ontario" as sub categories. However, the movies category should not have any sub categories. The problem is that when I choose Movies in the sub datasheet, the subcategory lookup still shows Canada London and Ontario when I don't want it to show anything. It doesn't make sense to have a Movies category with a London subcategory.
View 13 Replies
View Related
Apr 24, 2015
The Lookup table has two fields containing values that are needed: Description and Amount ($). In the table that uses the Lookup, I'd like to have both values shown, but have a dropdown just once. In other words, when the user selects a description (the dropdown shows both the description and amount), can the amount be inserted into an Amount field as the description is done currently.
View 4 Replies
View Related
Jan 16, 2008
I have been working with a simple Dlookup to return a value based on the data held in a specific field. I am now trying to develop this further and need some help.
I have a query "QryMainForm" that brings together fields from 2 tables "TblFS" (fields: Ref, score 1, score 2) and "TblFamily" (fields: Familyname). the query adds the values in Score 1 and Score 2 and saves the value as "points".
Seperatly from this i have a table "Tbllevels" which contains the fields Score, Operational, Admin, Technical. with the points scored relating to a value within each field. What i need to do is run the lookup based on the both "points" and Familyname fields contained in the query.
So the TblLevels looks like this:
Score.....Technical.....Operational.......Admin
100........................... Level 1.........Level 2
200 ........Level 1..........Level 2.........Level 3
300.........Level 2..........Level 3
400.........Level 3
So someone who scores 300 points could be assigned to the technical or operational group (this is done manually). What i need the lookup to do is to return the level based on the points and Familyname fields located on "qrymainform"
any ideas on how i can do this one?
View 10 Replies
View Related
Apr 4, 2006
Hi,
Is there anyway to have a single field in a table which is populated via the use of a lookup onto another table, but allowing multiple value selection out of the lookup table and populating those into the field...
For example
Table 1 is customer details
Table 1 field 3 = areas of interest
Table 1 field 3 is populated via a lookup into Table 2 interests
Table 2 has 4 records
Sport
Household
Motoring
Family
I want to be able to select 1 or more of the Table 2 values and populate them into Table 1 Field 3....
Help my head hurts....
View 3 Replies
View Related
Jun 24, 2014
I have two tables one with all the personnel (tblPersonnel) I'm tracking, another with different report names (tblReports).
For each report, there are different years that it's valid for.
On the reports table, I have three columns, ReportID, Report_Title, and Years_Valid
I'm using a lookup on the personnel table that stores the report name as the ReportID.
What I want to do is in a query use the Years_Valid column to automatically generate review dates bases on dates already in the database.
View 6 Replies
View Related
Sep 19, 2012
I am building a small database to automate the process of producing sales reports for our sales staff using data from our customers (distributors). They provide us with Excel spreadsheets with detailed sales data for our brands at THEIR customers (retail stores).The problem is that many stores receive from two distributors, and each distributor of course has different "customer numbers" for the store. I've built the database with the following:
tblStores (containing the list of stores)
StoreID
Distributor1StoreID
Distributor2StoreID
Distributor3StoreID
tblSalesData (containing the monthly sales per store, by brand)
StoreID
Brand1Sales
Brand2Sales
...
etc
When the distributor provides the spreadsheet, they use their Distributor1StoreID (or 2 or 3, depending on the distributor). I want to import it to tblSalesData but would need to lookup the StoreID from the tblStores during the import, using Distributor1StoreID, etc.
View 3 Replies
View Related
Oct 26, 2005
I apologize if this has been adressed. I searched but did not find it. Partially I think because it won't let me use the word 'two' in the search. That's kinda important in this case.
I know how to make a lookup combo box. I used the wizard and copied and pasted the code, actually. What I need is the code to base the lookup from two combos.
For example, the records in my table contain information about different districts on certain dates.
I'd like to lookup the record that matches both the Report Date combo and the District combo.
Thanks in advance.
View 12 Replies
View Related
Jul 8, 2013
Custom Autonumber based on lookup. I am creating an access database where autonumbers to be work.
I have a table with Segment Name my main table will lookup the values of segment table.
Based on the Segment I choose Autonumber has to be created
My main table to house each record (tbl_import) has the following fields:
ID
Segment
Port
MOT
TOTAL CIF
Child table - Segment contains
Development
Deployment
Testing
So based on segment field which I choose
Development autonumber has to set DEV-1001 and Deployment has to set DEP-2001, TEST-3001
My thought is if there a way to code the Segment field to lookup the segment what I choose based on the Autonumber series starts (similar to a vlookup in excel), then concatenate the DEV in the Record ID field.
View 2 Replies
View Related
Jan 11, 2014
i am working on a school database, in data base i have create two tables tblAccounts and tblTransaction and a form frmTransaction .
tblAccounts contain two fields
GLcodes
Description
and frmTransaction contain
Glcode
transaction type
debit
credit
date
narratives
in form when i enter a glcode, lookup field match the code from tblaccounts and shows the description in form against gl code.But i am facing a problem when i enter a wrong gl code my form accept it and move to the next field and when i leave blank field of glcode same problem that i am facing, i want that , when i enter a wrong glcode in a form amsgbox will apear that asking for correct glcode.
View 5 Replies
View Related
May 1, 2015
I have two tables,
tbl_Retainer
tbl_Retainer_Grant_Funding
tbl_Retainer has the field,
Retainer_ID
And tbl_Retainer_Grant_Funding has the fields,
Retainer_ID (a lookup field from tbl_Retainer)
Agreement_Num (a lookup field from tbl_Grant)
I have a form based off of a query(not sure if that matters), that uses that tables, tbl_Assignment and tbl_Assignment_Grant_Funding. These tables have the above fields as lookup fields.
So...what happens is, if an Assignment has a Retainer, I want the Agreement_Num box to show only the Agreement_Num's associated with that Retainer, otherwise just show all the Agreement Num's.
In my form, I have Retainer_ID with the row source,
SELECT tbl_RETAINER.Retainer_ID FROM tbl_RETAINER;
And Agreement_Num with the row source,
SELECT [tbl_GRANT].Grant_ID, [tbl_GRANT].Agreement_Num FROM tbl_GRANT ORDER BY [Agreement_Num];
In my AfterUpdate event for Retainer_ID I have,
Private Sub Retainer_ID_AfterUpdate()
Dim strSql As String
strSql = "SELECT [Retainer_ID]," & _
"[Agreement_Num]," & _
"FROM tbl_RETAINER_GRANT_FUNDING" & _
"WHERE [Retainer_ID] = " & Me.Retainer_ID.Value
Me.Agreement_Num.RowSource = strSql
Me.Agreement_Num.Requery
End Sub
When I am in my form and choose a Retainer ID, the Agreement_Num box goes blank, and there are no choices to choose from. I am wondering if this is because the Agreement_Num's are sourced from tbl_Grant and not from tbl_Retainer_Grant_Funding.
View 6 Replies
View Related
Nov 27, 2012
I have a database for scheduling students' for tests. They can take up to six tests in a day. There are about 80 different tests that they can take.
In my table, I created columns titled Test1, Test2, Test3, etc. They are lookup columns and I chose to enter my own values, putting in the tests titles for the values in each column.
When I add these drop-down lookup fields onto the form, it will only display 37 of these values. When I go back to the table and select "edit list items," it shows that it did cut the list off at 37, even though originally it allowed me to enter all 80-ish titles.
Anyway. It appears that there are limited values you can have in a lookup column, though after doing a lot of searching online I can't find anything to indicate that is true.
It seems to me that it would be smarter to set this up with two different tables, storing the reg info in one table and the test titles in another table. However, I am having a hard time figuring out the relationship aspect of this solution and how to make it pull up the correct values for queries/reports as well.
View 6 Replies
View Related
Oct 19, 2013
I wanted to create a form where you can select multiple values from the table "years" and on a button it would open a query displaying all the records in "students" in those years selected.
View 3 Replies
View Related
Oct 3, 2007
Hi. I'm quite poor with Access, so sorry if this sounds dumb.
I have a table of customer records (tbl_customers), including name, address & postcode etc
I have a spreadsheet of customers their postcodes from a different system that shows customers who have bought a particular product.
Is there a way that I can create a query that lists those records in tbl_customers whose postcode is matched in the spreadsheet?
Jim
View 3 Replies
View Related