Solved

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

Posted on 2012-04-11
8
430 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

860 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