470,609 Members | 1,791 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,609 developers. It's quick & easy.

Lookup Tables (list/combo boxes)?

I use a lookup table which contacts 2 fields (item#, name)

When a customer places an order, the order form contains a drop down to select the item by name (from the lookup table). The detail is stored by item # in a customer order table. The form displays the name, but is column bound to the item#.

When I want to create a report or form showing what the customer has ordered, I would like to display the name in a textbox control, but the only way I can get it to convert from the item# (stored in the field) to the 'name' is to use a list/combo control and set the lookup table. This does two things: 1) makes the field larger by having the pull-down arrows as part of the field; 2) always highlights it on the form/report. As this field is invariably disabled, it looks like crap.

Question: How can I translate the 'name' of an item in a lookup table from the item # to display the 'name' without using a combo/list control type?
Aug 15 '07 #1
1 1541
Sounds like you need to use Dlookup. If txtitem is the item no field (which doesn't have to be visible - it can be on the form with Visible=False). then the "name" field would contain this formula:

=Dlookup("name","master_table","item=" & txtitem)

(I'm assuming item is numeric, othewise enclose it in single quotes.

Hope this helps
Aug 15 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by my-wings | last post: by
1 post views Thread by James | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.