Dlookup: multiple results from a single field

RoboCop1

New member
Local time
Today, 07:32
Joined
Jul 22, 2022
Messages
1
Hello Access World,
I'm brand new to using access so I'm hoping someone can help me with an issue. I can do a vlookup in excel but i cant seem to figure out the dlookup for access. I just cant find anything on this. And i hope my question makes sense.

Im trying to figure out a dlookup code for an "AfterUpdate" action for a Form. I already know that i need to go into the property sheet.

So i have Table1 (which is actually the 2nd table) and a Form.
I need the form to automatically populate DESC1 and DESC2 when a room number is entered based on ID primary keys record no matter where the primary key is sorted on table.

View attachment 101954
 
Last edited:
Welcome to the forums! We are the most active Microsoft Access community on the internet by far, with posts going back over 20 years!

To get started, I highly recommend you read the post below. It contains important information for all new users to this forum.

https://www.access-programmers.co.uk/forums/threads/new-member-read-me-first.223250/

We look forward to having you around here, learning stuff and having fun!
 
Here is info on DLookup()

If the ID control was a combo, you could bring in the descriptions as extra columns.
 
I need the form to automatically populate DESC1 and DESC2 when a room number is entered based on ID primary keys record no matter where the primary key is sorted on table.

This doesn't smell right. A Dlookup retrieves data from a table. What table do you want to retrieve data from?

Before you say 'Table1', there's no need. If your form is based on Table1, you don't need to retrieve data from it, its already available. Do you have another table that holds description information for your rooms? If so, you can do a Dlookup into that table, but you would not store the description data in Table1--you would simply show it on the form,
 
Hi. Welcome to AWF!

It might be easier to use a Combobox in your case.

Just a thought...
 

Users who are viewing this thread

Back
Top Bottom