using lookup table in a form

  • Thread starter klapheck via AccessMonster.com
  • Start date
K

klapheck via AccessMonster.com

my main table has a code in a field.
I have a lookup table that has two fields: 1 code, 2 code description
on my form (Main) it currently displays the code, I want it to display the
description.
what is the simplist way to do this?

I thought dlookup would work with

=DLookUp("descript","qrycode",Forms!frmMain!ID)
ID is the key for the record

this is my qrycode, it works OK, when I run it, it asks for student ID when I
put it in the Student ID it gives me the description to the code of that
record.
SELECT tblLook.descript
FROM tblLook INNER JOIN tblMain ON tblLook.code = tblMain.code
WHERE (((tblMain.ID)=[]));

I also tried it without using a query just the tables and I could not get it
to work either
 
A

Arvin Meyer [MVP]

Use a combo box that has a rowsource of your table. If you set the first
column width to 0" it will display only the second column. You can use a
listbox to display both.
 
Top