A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

If i need a dropdown field (e.g. A, B or C) - is it best to design it in the table or the form?



 
 
Thread Tools Display Modes
  #1  
Old August 8th, 2008, 10:04 AM posted to microsoft.public.access,microsoft.public.access.formscoding,microsoft.public.access.tablesdbdesign
JethroUK©
external usenet poster
 
Posts: 188
Default If i need a dropdown field (e.g. A, B or C) - is it best to design it in the table or the form?

If i need a dropdown field (e.g. A, B or C) - is it best to design it in the
table or the form?

  #2  
Old August 8th, 2008, 10:32 AM posted to microsoft.public.access,microsoft.public.access.formscoding,microsoft.public.access.tablesdbdesign
Albert D. Kallal
external usenet poster
 
Posts: 2,874
Default If i need a dropdown field (e.g. A, B or C) - is it best to design it in the table or the form?

"JethroUK©" wrote in message
...
If i need a dropdown field (e.g. A, B or C) - is it best to design it in
the table or the form?


I think the answer depends on if the list will ever change?

if the drop down is to be only limited to two options, then you can go with
building it into the list. (say, "night" and "day" being the only options.

However, in almost ALL cases it is better to go with a small table. The
*big* reason is two fold:

1 - that silly boss always comes along and changes his mind..and add's more
options. If you use a table, then additional options can be added over time
without having to design/modify the form.

2 - for user friendly software, you have to report on that data, and sure
enough you want a prompt screen that allows the user to select/filter by
those options. If you put the list in the form then when you built another
form that prompts for reports etc, you likely need that list again. If the
list is based on a table then you can use that one master list in any place
in the application.

It usually best to avoid hard coding the list in the form since then you
start to have to maintain duplicate copies of the list.

Since it really is never much a performance issue, the choice is about most
flexibly and that's useally a table.


--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada



  #3  
Old August 8th, 2008, 12:20 PM posted to microsoft.public.access.formscoding,microsoft.public.access.tablesdbdesign,microsoft.public.access
Fred
external usenet poster
 
Posts: 1,451
Default If i need a dropdown field (e.g. A, B or C) - is it best to de

Jethro's question could be either of two questions:

1. Hard code the list (e.g. in a form) vs. using a seperate table for the
source

2. Embedded in the main table design vs. "add on" later (in a form)

Albert answered #1. If it's question #2, the developers say "add on
later" and I usually embed it in the table. The difference is that
developers usually deal with larger groups of users, or uncontrollable users.
And so they are in an a situation where the can and need to limit the user
interface to forms. Us little people often work directly in queries and
sometimes even directly in tables. The "embed in the table" idea has some
downsides, but has the advantage of making the dropdown available in the
queries and tables, not just forms.

"Albert D. Kallal" wrote:

"JethroUK©" wrote in message
...
If i need a dropdown field (e.g. A, B or C) - is it best to design it in
the table or the form?


I think the answer depends on if the list will ever change?

if the drop down is to be only limited to two options, then you can go with
building it into the list. (say, "night" and "day" being the only options.

However, in almost ALL cases it is better to go with a small table. The
*big* reason is two fold:

1 - that silly boss always comes along and changes his mind..and add's more
options. If you use a table, then additional options can be added over time
without having to design/modify the form.

2 - for user friendly software, you have to report on that data, and sure
enough you want a prompt screen that allows the user to select/filter by
those options. If you put the list in the form then when you built another
form that prompts for reports etc, you likely need that list again. If the
list is based on a table then you can use that one master list in any place
in the application.

It usually best to avoid hard coding the list in the form since then you
start to have to maintain duplicate copies of the list.

Since it really is never much a performance issue, the choice is about most
flexibly and that's useally a table.


--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada




  #4  
Old August 8th, 2008, 03:40 PM posted to microsoft.public.access.formscoding,microsoft.public.access.tablesdbdesign,microsoft.public.access
Klatuu
external usenet poster
 
Posts: 7,074
Default If i need a dropdown field (e.g. A, B or C) - is it best to de

"Us little people often work directly in queries and sometimes even directly
in tables."

Then you don't really have an application. It is most likely a "spreadsheet
on steriods"

IMHO, data belongs in tables. A list of options is data.

--
Dave Hargis, Microsoft Access MVP


"Fred" wrote:

Jethro's question could be either of two questions:

1. Hard code the list (e.g. in a form) vs. using a seperate table for the
source

2. Embedded in the main table design vs. "add on" later (in a form)

Albert answered #1. If it's question #2, the developers say "add on
later" and I usually embed it in the table. The difference is that
developers usually deal with larger groups of users, or uncontrollable users.
And so they are in an a situation where the can and need to limit the user
interface to forms. Us little people often work directly in queries and
sometimes even directly in tables. The "embed in the table" idea has some
downsides, but has the advantage of making the dropdown available in the
queries and tables, not just forms.

"Albert D. Kallal" wrote:

"JethroUK©" wrote in message
...
If i need a dropdown field (e.g. A, B or C) - is it best to design it in
the table or the form?


I think the answer depends on if the list will ever change?

if the drop down is to be only limited to two options, then you can go with
building it into the list. (say, "night" and "day" being the only options.

However, in almost ALL cases it is better to go with a small table. The
*big* reason is two fold:

1 - that silly boss always comes along and changes his mind..and add's more
options. If you use a table, then additional options can be added over time
without having to design/modify the form.

2 - for user friendly software, you have to report on that data, and sure
enough you want a prompt screen that allows the user to select/filter by
those options. If you put the list in the form then when you built another
form that prompts for reports etc, you likely need that list again. If the
list is based on a table then you can use that one master list in any place
in the application.

It usually best to avoid hard coding the list in the form since then you
start to have to maintain duplicate copies of the list.

Since it really is never much a performance issue, the choice is about most
flexibly and that's useally a table.


--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada




  #5  
Old August 8th, 2008, 05:15 PM posted to microsoft.public.access.formscoding,microsoft.public.access.tablesdbdesign,microsoft.public.access
JethroUK©
external usenet poster
 
Posts: 13
Default If i need a dropdown field (e.g. A, B or C) - is it best to de



"Klatuu" wrote in message
...


IMHO, data belongs in tables. A list of options is data.


so would you include a dropdown in the table design or the form design? -
i'm inclined to put it in the table but after few into the design i don't
want to change my mind

  #6  
Old August 8th, 2008, 05:30 PM posted to microsoft.public.access.formscoding,microsoft.public.access.tablesdbdesign,microsoft.public.access
Klatuu
external usenet poster
 
Posts: 7,074
Default If i need a dropdown field (e.g. A, B or C) - is it best to de

In your data table you want a Numeric Long Integer field to store a
reference to the code.

Then you want a table with the codes that has two fields.
An Autonumber field that is the primary key of the code table
A text field that contains the description of the code.

You would enter each option as a record. If you have A, B, and C, then you
would have 3 records.

Then on your form, your combo box would have a row source of:
SELECT codeID, CodeDescription FROM tblCode ORDER BY CodeDescription;

Set the following properties:
Bound Column = 1
Colmumn Count = 2
Column Widths = 0";1" = The 0" will make the codeID hidden. The 1" can be
whatever you need to display the descritive text.

The combo should be bound to the Code field in the main data table. Now,
when you select an option, the numeric value of that option will be store in
the main table.

--
Dave Hargis, Microsoft Access MVP


"JethroUK©" wrote:



"Klatuu" wrote in message
...


IMHO, data belongs in tables. A list of options is data.


so would you include a dropdown in the table design or the form design? -
i'm inclined to put it in the table but after few into the design i don't
want to change my mind


  #7  
Old August 8th, 2008, 06:13 PM posted to microsoft.public.access.formscoding,microsoft.public.access.tablesdbdesign,microsoft.public.access
bcap[_2_]
external usenet poster
 
Posts: 260
Default If i need a dropdown field (e.g. A, B or C) - is it best to de

I think most people here are answering the wrong question. The way it reads
to me, the question Jethro is asking is, quite simply, "Should I create a
lookup field in a table?".

To which the answer is emphatically "NO"!

http://www.mvps.org:80/access/lookupfields.htm

"JethroUK©" wrote in message
...


"Klatuu" wrote in message
...


IMHO, data belongs in tables. A list of options is data.


so would you include a dropdown in the table design or the form design? -
i'm inclined to put it in the table but after few into the design i don't
want to change my mind



  #8  
Old August 8th, 2008, 06:23 PM posted to microsoft.public.access.formscoding,microsoft.public.access.tablesdbdesign,microsoft.public.access
Klatuu
external usenet poster
 
Posts: 7,074
Default If i need a dropdown field (e.g. A, B or C) - is it best to de

I would agree you should not use lookup fields, but my post is explaining the
correct way to handle it.
--
Dave Hargis, Microsoft Access MVP


"bcap" wrote:

I think most people here are answering the wrong question. The way it reads
to me, the question Jethro is asking is, quite simply, "Should I create a
lookup field in a table?".

To which the answer is emphatically "NO"!

http://www.mvps.org:80/access/lookupfields.htm

"JethroUK©" wrote in message
...


"Klatuu" wrote in message
...


IMHO, data belongs in tables. A list of options is data.


so would you include a dropdown in the table design or the form design? -
i'm inclined to put it in the table but after few into the design i don't
want to change my mind




  #9  
Old August 8th, 2008, 09:39 PM posted to microsoft.public.access.formscoding,microsoft.public.access.tablesdbdesign,microsoft.public.access
Fred
external usenet poster
 
Posts: 1,451
Default If i need a dropdown field (e.g. A, B or C) - is it best to de

Dave,

There is absolutely no basis for saying what you said. The types of
situations where the advantages of an embedded-in-table lookups outweigh the
disadvantages (with a lengthier post I could describe some examples) have
absolutely nothing do with the attributes that differentiate between
spreadsheet and database structures/applications.

Fred






"Klatuu" wrote:

"Us little people often work directly in queries and sometimes even directly
in tables."

Then you don't really have an application. It is most likely a "spreadsheet
on steriods"

IMHO, data belongs in tables. A list of options is data.

--
Dave Hargis, Microsoft Access MVP


"Fred" wrote:

Jethro's question could be either of two questions:

1. Hard code the list (e.g. in a form) vs. using a seperate table for the
source

2. Embedded in the main table design vs. "add on" later (in a form)

Albert answered #1. If it's question #2, the developers say "add on
later" and I usually embed it in the table. The difference is that
developers usually deal with larger groups of users, or uncontrollable users.
And so they are in an a situation where the can and need to limit the user
interface to forms. Us little people often work directly in queries and
sometimes even directly in tables. The "embed in the table" idea has some
downsides, but has the advantage of making the dropdown available in the
queries and tables, not just forms.

"Albert D. Kallal" wrote:

"JethroUK©" wrote in message
...
If i need a dropdown field (e.g. A, B or C) - is it best to design it in
the table or the form?

I think the answer depends on if the list will ever change?

if the drop down is to be only limited to two options, then you can go with
building it into the list. (say, "night" and "day" being the only options.

However, in almost ALL cases it is better to go with a small table. The
*big* reason is two fold:

1 - that silly boss always comes along and changes his mind..and add's more
options. If you use a table, then additional options can be added over time
without having to design/modify the form.

2 - for user friendly software, you have to report on that data, and sure
enough you want a prompt screen that allows the user to select/filter by
those options. If you put the list in the form then when you built another
form that prompts for reports etc, you likely need that list again. If the
list is based on a table then you can use that one master list in any place
in the application.

It usually best to avoid hard coding the list in the form since then you
start to have to maintain duplicate copies of the list.

Since it really is never much a performance issue, the choice is about most
flexibly and that's useally a table.


--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada




  #10  
Old August 8th, 2008, 09:46 PM posted to microsoft.public.access.formscoding,microsoft.public.access.tablesdbdesign,microsoft.public.access
Klatuu
external usenet poster
 
Posts: 7,074
Default If i need a dropdown field (e.g. A, B or C) - is it best to de

Fred,
I respect your opinions are your posts here are always very helpful.
In this case, however, we will have to agree to disagree. You would not be
able to convence me a lookup field is a good alternative in any situation.
First, it is confusing to users. How many posts have you seen here where
the OP can't figure out why he is getting numbers instead of what he thought
was in the field?

And, an important consideration is that should upsizing become a serious
consideration, it is a redo. Only Jet has lookup fields. To upsize to SQL
Server, you would have to rewrite it as I have described any way.

But, keep up the good work, Fred. I alway enjoy reading your posts.
--
Dave Hargis, Microsoft Access MVP


"Fred" wrote:

Dave,

There is absolutely no basis for saying what you said. The types of
situations where the advantages of an embedded-in-table lookups outweigh the
disadvantages (with a lengthier post I could describe some examples) have
absolutely nothing do with the attributes that differentiate between
spreadsheet and database structures/applications.

Fred






"Klatuu" wrote:

"Us little people often work directly in queries and sometimes even directly
in tables."

Then you don't really have an application. It is most likely a "spreadsheet
on steriods"

IMHO, data belongs in tables. A list of options is data.

--
Dave Hargis, Microsoft Access MVP


"Fred" wrote:

Jethro's question could be either of two questions:

1. Hard code the list (e.g. in a form) vs. using a seperate table for the
source

2. Embedded in the main table design vs. "add on" later (in a form)

Albert answered #1. If it's question #2, the developers say "add on
later" and I usually embed it in the table. The difference is that
developers usually deal with larger groups of users, or uncontrollable users.
And so they are in an a situation where the can and need to limit the user
interface to forms. Us little people often work directly in queries and
sometimes even directly in tables. The "embed in the table" idea has some
downsides, but has the advantage of making the dropdown available in the
queries and tables, not just forms.

"Albert D. Kallal" wrote:

"JethroUK©" wrote in message
...
If i need a dropdown field (e.g. A, B or C) - is it best to design it in
the table or the form?

I think the answer depends on if the list will ever change?

if the drop down is to be only limited to two options, then you can go with
building it into the list. (say, "night" and "day" being the only options.

However, in almost ALL cases it is better to go with a small table. The
*big* reason is two fold:

1 - that silly boss always comes along and changes his mind..and add's more
options. If you use a table, then additional options can be added over time
without having to design/modify the form.

2 - for user friendly software, you have to report on that data, and sure
enough you want a prompt screen that allows the user to select/filter by
those options. If you put the list in the form then when you built another
form that prompts for reports etc, you likely need that list again. If the
list is based on a table then you can use that one master list in any place
in the application.

It usually best to avoid hard coding the list in the form since then you
start to have to maintain duplicate copies of the list.

Since it really is never much a performance issue, the choice is about most
flexibly and that's useally a table.


--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:42 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.