Solved

Table Definition - Set lookup values based on another field in table

Posted on 2012-04-11
8
421 Views
Last Modified: 2012-04-11
I am working on an Access 2010 database (32 bit, accdb). Within this database I am attempting to create a dynamic data validation process, wherein the user can identify fields in tables they want validated, and define what they want those fields validated against.
I have two tables in this database listing the tables in the database that will be validated plus the table(s) that will be used for validation, and all of the fields in these selected tables (tblDdTable and tblDdField, respectively).
I am now creating a new table named tblDdRules. One of the fields in this new table is "TableName". This field is defined with a combobox lookup which queries the table names in tblDdTable. The next field is "FieldName". I would like to define a combobox lookup which queries tblDdField using the value in the prior field "TableName" as the key.
I am attaching a small database with the three tables mentioned in the first post.
Here is an image of the lookup defined for the TableName field. How would I set up the query for the FieldName lookup?
image 1Lookup-Question.accdb
0
Comment
Question by:shambalad
  • 5
  • 3
8 Comments
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
ID: 37833083
Is your goal here simply to select a table from one combobox, and have a second combobox display the associated fields?
If so then see the attached sample.


As was stated by the first expert.
This is a *Nightmare* in tables.. , this is typically done in a form
See here for more info:
http://access.mvps.org/access/lookupfields.htm

JeffCoachman
Database115.mdb
0
 
LVL 7

Author Comment

by:shambalad
ID: 37833180
Duly noted. I know how to do this on a form.
Won't someone simply tell me how this is done in a table definition?
0
 
LVL 7

Author Comment

by:shambalad
ID: 37833236
I have to apologize. I've managed to get two questions running concurrently on the same topic. I closed out the other, but then the Expert responded with more input. I am going to close out this question and focus the discussion on the earlier question.
http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_27670012
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 7

Author Closing Comment

by:shambalad
ID: 37833237
0
 
LVL 7

Author Comment

by:shambalad
ID: 37833575
I just posted this in the other question:
FWIW:
Some years ago I was supporting multiple Access databases for a major Health insurer. The individual who originally created the databases had extensively used lookups in the table definitions, so I know just how much of a major PITA they can be.
I still want to know how I can create a lookup which filters based on the value of another field in the table.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37833919
Then this will take a bit of work.
Unfortunately, I just can't spare the time to do this as a volunteer here..

Sorry, Perhaps another Expert will help out
0
 
LVL 7

Author Comment

by:shambalad
ID: 37834003
You're right. It's not worth it. As I develop, I sometimes digress into what amount to more intellectual efforts than anything else. This would fall into that category.
I know these lookups are impractical for client databases, but it could be a useful tool for me personally.
Thanks anyway.
th
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37834128
<I know these lookups are impractical for client databases, but it could be a useful tool for me personally.>
That is what I though as well, ...at one time...

In addition to what the link states...
You cannot paste the visible text or the numerical value directly into the combobox/field.
Alos, this "Datatype" is not currently supported by SQL Server, so it will be worthless, when you need to upsize


It is far beter "for your own understainding" to keep the data as "raw" as possible in the tables...


In this same vein, do as much research as you can before using other "Access only" features:
Multivalues fields
Hyperlink Fields
OLE fields
Attachment fields
...etc

These all have their place *In MS Access* , but when it comes time to upsize, they may have to be tossed...

JeffCoachman
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question