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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lookup field without displaying ID

Status
Not open for further replies.

almoes

Programmer
Jan 8, 2003
291
US
Hi!

I am trying to make a lookup in a db and I want to display on the combo box only the name, but store the ID of it. Can this be achieved with lookup fields? I can only manage to do it displaying aldo the ID. I discovered a workaround, setting the column width of the ID to cero, but don't really like it. Thanxs!

cheers,
alej
 
setting the column width of the ID to zero
Seems to be the standard way.
 
Can this be achieved with lookup fields?

Create a lookup TABLE to contain the values to be looked up with Id field and Description field

Have the combo box'es RowSource something like
"SELECT LookupId, Description FROM tblLoopUp"

Then set the combo's ControlSource = XYZ
( Where XYZ is the name of the field in the main table that is to store the data )

set the combo's BoundColumn = 1
and RowCount = 2
and ColumnWidth = 0 ;

That works well and IS the standard approach

DO NOT, under any circumstances make field XYZ into a Lookup FIELD !



'ope-that-'elps.



G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
that looks cool! try it next week..thanxs again!!

alej
 
It works quite well!
and now, to do the same with a text box? :-S

thanxs!
alej
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top