Where to put combo boxes and which field to save in table?

Abiart

Registered User.
Local time
Today, 02:19
Joined
May 17, 2006
Messages
27
Hi there,

I have been doing this long enough to know that lots of people see using a combo box on a table as bad, and having it on the form instead is preferable. On my current project I have the opportunity to take heed of this advice at the beginning, but I think I'm a litte confused as to exactly what the best use of the combo is.

In the past I have used a combo on the main table to look up standard values in other tables. I always had an autonumber ID as the primary key in the value tables, and the combo was bound to the PK (ID) field but I set the column widths to "0cm; 2.5cm", for example, so that the value name, not the ID number, was shown.

I know the pitfall of this process is that you often end up with ID numbers, not valuable data, being stored in your main table, which is a headache when you want to do things like exporting etc.

To put the db in context and help simplify the description of my problem, the database will keep track of which news item was sent to whom and when. The main table is called tblNewsletters, and I also have tblCategories, tblLists, tblMonths, tblStories and tblYears. With the exception of tblStories, each of these contains a list of values to be looked up from the form frmNewsletters.

I was under the impression I was supposed to store these values as text in tblNewsletters (e.g. CategoryA, February, 2007, OwnList, NewProductStory - not as proprietary numbers). Unfortunately I can't work out how to do this and I thought maybe I was missing the point?

Forgive me for bringing up this subject again; I know this issue has come up before in the forums, but I couldn't find anything relating directly to it.

Any suggestions or explanations would be gratefully received! Thank you.

-Abby
 
Aha - I think I have solved the problem. Just because the ID field is the PK, doesn't mean it should be the bound field. I changed the bound field to "2" and it all fell into place!
 
Abiart said:
Aha - I think I have solved the problem. Just because the ID field is the PK, doesn't mean it should be the bound field. I changed the bound field to "2" and it all fell into place!

That's interesting. Normally in a dual data combo, the PK would be 0 and the bound text field 1. Hmmmm. :)
 

Users who are viewing this thread

Back
Top Bottom