473,407 Members | 2,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

2 Level lookup in a table

Hi,

I am baffled on this one and perhaps just a bit brain dead. I have a table with two look up columns.

Structure

Departments
Dept_ID Autonum
Dept_Name Text

Groups
Group_ID Autonum
Dept_ID Num
Group_Name Text

Teams
Team_ID Autonum
Dept_ID Num
Group_ID Num
Team_Name Text

In a table=based look up for Group_ID in the table Teams, I need to limit the returned records from a query on Groups to the subset where Dept_ID equals the previously looked up Dept_ID.

I know the query is going to look something like this:

SELECT Groups.Group_ID, Groups.Group_Name
FROM Groups
WHERE (((Groups.Dept_ID)=???????))
ORDER BY Groups.Group_Name;

but how do I refer to the Dept_ID I just looked up in the row I am entering?

Thanks in advance for the help
Mar 17 '09 #1
8 1975
FishVal
2,653 Expert 2GB
@dnorris
Hello, dnoriss.

Unfortunately, this doesn't make much sense. Could you elaborate further on it?
Example of unfiltered data and desired output would be nice as well.

Regards,
Fish.
Mar 17 '09 #2
In the table Names, I first do a look up for Dept_ID using all the available records in the table Department, then I want I do a look up for Group_ID where I limit the rows displayed from the table Groups where Groups.Dept_ID equals the value Dept_ID for the row I am currently entering.

I can do this in a form, but I would like to build this into the design for the Table Names.
Mar 17 '09 #3
FishVal
2,653 Expert 2GB
What is table [Names] ?
Mar 17 '09 #4
Du'h

I meant the Teams table
Mar 18 '09 #5
FishVal
2,653 Expert 2GB
Well.

What does mean "I first do a look up for Dept_ID using all the available records in the table Department"?
Does it mean table [Teams] could contain Dept_ID values not matching those in [Departments] table? How do you perform this "look up"?

What the second "look up" means?
Does it mean the desired records are those where [Dept_ID]/[Group_ID] combination match that in [Groups] table?
If so, then why would you need 2 level filtering?
Does it mean [Groups] table could contain [Dept_ID] not matching any in [Departments] table?
Mar 18 '09 #6
It the table design view, there is a 'lookup' tab for each field that allow a listbox to display the rows from a table or query.

When a user is entering/editing a row in Teams, they first choose Dept_ID from a listbox of all rows in Departments (I have that working). Then then choose Group_ID from a listbox of all rows in Groups where Groups.Dept_ID equals the value of Dept_ID in the current rows (this is what is not working).

How do I get the value of Dept_ID for the current row (in Teams) into the WHERE clause in the Lookup associated with the field Teams.Group_ID?
Mar 18 '09 #7
FishVal
2,653 Expert 2GB
It won't work anyway in "table view".
Read Cascading Combo/List Boxes howto to get it working in form.
Mar 18 '09 #8
I knew how to get it working in a form.

Thank you.
Mar 18 '09 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: John Collyer | last post by:
Hi, In assembly language you can use a lookup table to call functions. 1. Lookup function address in table 2. Call the function Like: CALL FUNCTION
12
by: Puvendran | last post by:
Hi, We have encountered deadlock on a table which is used to generate sequential numbers for different categories eg typical entries Category Value TRADE_NO ...
5
by: chintalas | last post by:
Here when many users are trying to update the same table the dead lock situation is arising. I like to know how i can put a lock at record level in my table, so that the dead lock situation will...
9
by: Koen | last post by:
Hi all, My application uses a lot of lookup tables. I've splitted the frontend (forms, reports, etc) from the backend (data). The database has around 10 different users. The values in the...
3
by: my-wings | last post by:
I've been reading about how evil Lookup fields in tables are, but I've got to be missing something really basic. I know this subject has been covered before, because I've just spent an hour or two...
1
by: Zachary Turner | last post by:
I want to make a Lookup Field based on another Lookup field. In other words, I have this table A with two fields: ID and Name, where ID is an Autonumber and Name is a friendly name. Then I have a...
2
by: Kostas | last post by:
Just a quick question on this issue. Assume a small set of fixed values for a field. For instance Field Gender, values: Male, Female, Unknown If I create a Combo Box with the above values, I...
1
by: Paul H | last post by:
Say I have a table called tblPeopleInfo, one of the fields in the table is called FavouriteFruit. The FavouriteFruit field is a lookup field and will contain Apples, Oranges, Grapes etc..The list...
4
by: jon f kaminsky | last post by:
Hi- I've seen this problem discussed a jillion times but I cannot seem to implement any advice that makes it work. I am porting a large project from VB6 to .NET. The issue is using the combo box...
0
by: =?Utf-8?B?RU1hbm5pbmc=?= | last post by:
(I originally posted this to the data access newsgroup but received no replies) I've got an Access 2003 mdb that I'm converting to VB.Net. I'm having trouble with getting the main data source to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.