Lookup from one table in another table's form

G

Guest

Hi, all.

As you know in Scandinavia we use «Post office number» and «Post office
name» when addressing post. Each post office has it's «Post office number»
and «Post office name». In a Access database of mine I have a table with two
colomns: «Post office number» and «Post office name». In a form users will
register persons with their home adresses. In a field they will write the
«Post office number», and I want the corresponding «Post office name» to
popup in another field. I'm quite a newbe to Access and wonder what is the
best way to do this. Please tell me as I think this is very simple in Access
....

Thank you very much in advance.

Jo
 
G

Guest

Instead of a text box for the Post office number, create a ComboBox that list
all the Post office number.

The combo RowSource will include both column "Post office number" And "Post
office name".
Select [Post office number],[Post office name] From TableName

Create a text box and using the control source of that text box, you can
refer to the second column of the combo (the name)
=[ComboName].Column(1)
Note: the column number start with 0, so the second column will be 1.

That way every time you select a Post office number the name will be
displayed automatically. Also, using the combo will prevent from the user to
input the wrong Post office number.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top