ComboBox

capsula4

Registered User.
Local time
Today, 11:24
Joined
Jan 3, 2008
Messages
122
I have read that many of you don't recommend lookup values in tables, instead making it by using relationships between tables.

I have:

tblTransactions: DAY, ID_COMPANY, TRANSACTION

tlkpCompanies: ID_COMPANY, COMPANY_NAME

I just don't get how to make the combobox in the form so as to Have

"Day: [DAY], Company: [ID_COMPANY]" where Company is a combobox. How do I make Company combobox display the name of the companies and not the IDs, and store IDs not the name of companies. :D
 
If you use the combo wizard, it should lead you through it. Basically the SQL behind it would return both fields, the bound column would be the ID field, but the column widths property would hide the id field (width of 0).
 
you can simplify your life by adding a control source in the table proper, on the second tab of the field properties. that way, when using the form wizard, if you use it, it will create a combobox item rather than a boring old text box.

if you check out the properties of the combobox, on the format tab there's a host of things, including the width of the box. specifically, the 3rd-5th menu items are:

column count. set to 2.
column heads (y/n)
column widths. set the width of the ID_company to 0".

on the data (second) tab however is what you really want: the bound column property. set the bound column to ID_company.

that help?

ed
 
darn it.

so lookups within the table proper are bad b/c they introduce bloat, are inaccurate, and add a layer of complexity without adding any value, then? i didn't know that.

thank you.

ed
 
Okay, I could make it by using the wizard.

It asks me where I wanna save the information of the combo and I can only choose COMPANY_NAME, not COMPANY_ID, is this okay?

Also I have noticed that sometimes it appears a new value in the combobox once I have already used the combobox, I'm guessing its saving the COMPANY_ID in COMPANY_NAME...

And one last suggestion... do you recommend me to relate the tlkpTables with tblTables? In this case I'm just using them for faster filling of info (there are not secondary info related)
 
right click the text box on the form after the wizard has run and select change to. you can then change the text box to a combo box, then add the query and set the other properties, number of columns width etc.
 

Users who are viewing this thread

Back
Top Bottom