Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lookups in tables and combos on forms - column numbers 1

Status
Not open for further replies.

Moss100

Technical User
Aug 10, 2004
586
GB
Hello,

Please can someone clarify the following.

If I create a lookup for a field in table design, I think the first column in the lookup table is referred to as column 1 (which may often be an ID field)

If however I use a combo on a form as a lookup to a table, the first column is column 0.

Is the above correct or am I getting confused?

From what I read the above seems to be right, but it seems odd that one would start at 1 and the other at 0.

Thank you Mark.
 
Mark,
You are confused. First IMO never use lookup fields in tables When referencing the combo box properties on a form, you never want to bind to the 0 column. This is an index based on the position in the order of values. However, when referencing the column numbers in VBA, the 0 column is actually the first column. So there is a difference in the form view vs the VBA code.

Duane
Hook'D on Access
MS Access MVP
 
Regarding lookup fields, I have seen too many questions by users who had implemented lookup fields but had multiple issues understanding what was actually stored and how to get the title/text field to display in reports, queries, forms,... They also have issues creating filters on the lookup fields.

I personally want to see the actual values stored in the fields. Also, I typically work with SQL Server tables that don't support lookup fields defined in tables.

Duane
Hook'D on Access
MS Access MVP
 
Well, personally I use look-up tables (for domains). They form part of my CDM / ERD plus as my back-end database is MS SQL, domains are not supported and so lookup tables are the only way to create domains for data set values. (you could hard code check constraints, but that can get ugly and hard to manage over time)

At least if you design the CDM incorporating domains / look-up tables with clearly defined relationships, you can see what is going on and code your application accordingly, I don't think I would obfuscate the relationship in the manner lookup-fields in access does.

If Duane says not to use it, it's usually best to leave it alone!


"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top