473,473 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Lookup field in table

Hi,

What is your opinion about using Lookup field in table. I would like to use
lookup field in table 1, so that I can choose data in combo box from table
2.
Is this good design of database?

Thanks in advance, Marco

Nov 12 '05 #1
7 3221
It is a very common design, but it is best to use forms for data entry
and not to expose tables to the users.

Pavel

Marco Simone wrote:

Hi,

What is your opinion about using Lookup field in table. I would like to use
lookup field in table 1, so that I can choose data in combo box from table
2.
Is this good design of database?

Thanks in advance, Marco

Nov 12 '05 #2
I agree with Pavel.

'lookup' is an expression that already has some meaning to Access users.
As such, it is likely to trigger a lively discussion.

If you mean a field that contains a copy of a primary key in another
table, that is called a foreign key. Perfectly legal, and even quite
necessary.

If you mean the display issue that Microsoft added to its table design,
allowing you to display a combobox in the place of the field, hiding the
actual data in the field, and displaying the corresponding value from
the "parent" table (with possibility to select another value from a
list), that is called a lookup field. It comes with an added
relationship, which becomes visible when you open the Relationship
window and choose to display all relationships. (Does it, John Vinson?
It may not, because the Relationship window is a little buggy.)

Standing advice is:
* do create that other (parent) table
* do create a relationship (but do so by hand, enabling you to choose
enforced relational integrity and cascading update, I like those)
* don't choose a display type in the original (child) table--even though
it adds the bonus that when you create a form on this table, the
combobox is already built for you. There are other, cleaner ways for that.

Marco Simone wrote:
Hi,

What is your opinion about using Lookup field in table. I would like to use
lookup field in table 1, so that I can choose data in combo box from table
2.
Is this good design of database?

Thanks in advance, Marco


--
Bas Cost Budde

Nov 12 '05 #3
Thanks for reply. I was thinking to use lookup field in table 1 for looking
for records from table 2.
In this way, I have same data in table 1 and table 2. Table 2 has all values
for user to choose, and in table 1 I choose 1 value (for every record) from
table 1. Off course, I use form for entering data in table 1 and 2. I hope
you understand what I am trying to say.
So this way I am duplicating data in table 1 (am I right and is this OK with
relational database).

Thanks, Marco

"Bas Cost Budde" <ba*@heuveltop.org> wrote in message
news:bv**********@news2.solcon.nl...
I agree with Pavel.

'lookup' is an expression that already has some meaning to Access users.
As such, it is likely to trigger a lively discussion.

If you mean a field that contains a copy of a primary key in another
table, that is called a foreign key. Perfectly legal, and even quite
necessary.

If you mean the display issue that Microsoft added to its table design,
allowing you to display a combobox in the place of the field, hiding the
actual data in the field, and displaying the corresponding value from
the "parent" table (with possibility to select another value from a
list), that is called a lookup field. It comes with an added
relationship, which becomes visible when you open the Relationship
window and choose to display all relationships. (Does it, John Vinson?
It may not, because the Relationship window is a little buggy.)

Standing advice is:
* do create that other (parent) table
* do create a relationship (but do so by hand, enabling you to choose
enforced relational integrity and cascading update, I like those)
* don't choose a display type in the original (child) table--even though
it adds the bonus that when you create a form on this table, the
combobox is already built for you. There are other, cleaner ways for that.

Nov 12 '05 #4
"Marco Simone" <ma*********@net.hr> wrote in message news:<bv**********@ls219.htnet.hr>...
Hi,

What is your opinion about using Lookup field in table. I would like to use
lookup field in table 1, so that I can choose data in combo box from table
2.
Is this good design of database?

Thanks in advance, Marco


Personally, I *never* use lookup fields. I find them confusing,
because they store the ID of the related field, so what you see is NOT
what you get. I prefer to use a combobox on a form and go that route.
Nov 12 '05 #5
> Thanks for reply. I was thinking to use lookup field in table 1 for looking
for records from table 2.
In this way, I have same data in table 1 and table 2. Table 2 has all values
for user to choose, and in table 1 I choose 1 value (for every record) from
table 1. Off course, I use form for entering data in table 1 and 2. I hope
you understand what I am trying to say.
So this way I am duplicating data in table 1 (am I right and is this OK with
relational database).


You are duplicating *some* of the data all right. That is exactly how it
is meant.
I hope the key field is small--but the idea is that in this other table
may live a lot more fields, all of which get referred to by the one key
(may consist of more fields!) that gets 'duplicated' in the other table.

--
Bas Cost Budde

Nov 12 '05 #6
Thanks for reply,

If I use combo box on a form , then I would have to use query to get data in
combo box from table 2, right?
Also, I am reading book about access and table 1 has lookup field for table
2, but table 2 doesn't have primary key, just field CITY. Is this ok,
because I was reading that every table should have primary key?

Thanks, Marco

"Pieter Linden" <pi********@hotmail.com> wrote in message
news:bf**************************@posting.google.c om...
"Marco Simone" <ma*********@net.hr> wrote in message

news:<bv**********@ls219.htnet.hr>...
Hi,

What is your opinion about using Lookup field in table. I would like to use lookup field in table 1, so that I can choose data in combo box from table 2.
Is this good design of database?

Thanks in advance, Marco


Personally, I *never* use lookup fields. I find them confusing,
because they store the ID of the related field, so what you see is NOT
what you get. I prefer to use a combobox on a form and go that route.

Nov 12 '05 #7
Since I expect that CITY is unique and identifying, it serves well as
primary key.

A table *must* not have a primary key in Jet, but having a primary key
reflects design choices. And it usually leads to a consistent and
controllable structure.

Marco Simone wrote:
Thanks for reply,

If I use combo box on a form , then I would have to use query to get data in
combo box from table 2, right?
Also, I am reading book about access and table 1 has lookup field for table
2, but table 2 doesn't have primary key, just field CITY. Is this ok,
because I was reading that every table should have primary key?

Thanks, Marco

"Pieter Linden" <pi********@hotmail.com> wrote in message
news:bf**************************@posting.google.c om...
"Marco Simone" <ma*********@net.hr> wrote in message


news:<bv**********@ls219.htnet.hr>...
Hi,

What is your opinion about using Lookup field in table. I would like to
use
lookup field in table 1, so that I can choose data in combo box from
table
2.
Is this good design of database?

Thanks in advance, Marco


Personally, I *never* use lookup fields. I find them confusing,
because they store the ID of the related field, so what you see is NOT
what you get. I prefer to use a combobox on a form and go that route.



--
Bas Cost Budde

Nov 12 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

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...
3
by: google | last post by:
I have a database with four table. In one of the tables, I use about five lookup fields to get populate their dropdown list. I have read that lookup fields are really bad and may cause problems...
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...
2
by: Greg Strong | last post by:
Hello All, Is it possible to change table field lookup properties in code? I've been able to change other field properties in code, however so far no luck with field lookup properties. What...
11
by: Paul H | last post by:
Suppose I have a table called tblPeople and I want a field to illustrate whether each person prefers cats or dogs. I could do it one of three ways. 1. A plain text field Create a text field in...
7
by: samdev | last post by:
I have set up a table with a few fields that are set to required....all work fine except the fields that are Lookup from another table. What am I forgetting to set? Thanks!!
14
by: Mark | last post by:
I have a table with a field that uses a combobox to populate values. The Lookup tab within table design mode is the following: Display Control Combo Box Row Source Type ...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
1
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.