I'm a n00b at Access, so I might not be approaching this in an Access-y way.
Say I have two tables, A
and B
. Every A
belongs to a B
, so A
has a column B_id
which is constrained to match the id
column of some row in the B
table.
So far, so good. This, I've done.
Now I want to create a form for people to create new rows in the A
table. I'd like to give them a dropdown to choose which B
this A
belongs to, but I don't want to just display a list of valid id
s - I'd rather show some other information from each B
which would be more human readable - something derived from the other columns. For simplicity, let's say I'd rather display B
's Name
column.
I tried to just modify the SELECT
statement used for the dropdown box, but that didn't work since it tried to populate the A
's B_id
column with values from B
's Name
column. What I need is have a dropdown that displays DLOOKUP("Name", "B", [B_id])
, but returns value B_id
.
I know how I'd do such a thing in HTML, but not in Access. Help?