Table Relationship Lookup in a Form

b_karv

Registered User.
Local time
Today, 12:16
Joined
Sep 15, 2004
Messages
31
Hi all,

I am wandering if anyone can help me here. I have a form which is linked to a table called tbl_File. Within in this form & tbl_File there is a field called Country_Code. In the Country_Code field the user places a number that corresponds to their country they want.

Now Country_Code & the corresponding country is defined in a seperate table called tbl_CountryCodes.

What I would like to do is in my form once the user has inputed a number in the Country_Code field (it will be a combo box), a label or textbox in the SAME form will then do a search of the corresponding Country name in tbl_CountryCodes and then display it to the user.

Any ideas will be greatful :D

Karv
 
If you base the ComboBox on a query of tbl_CountryCodes then the user will be able to pick from a list. The AfterUpdate event of the ComboBox can be used to put the actual CountryName in your TextBox with something like:
Me.TextBox = Me.ComboBox.Column(1)
You will have to use your control names and the Column count is zero based so Column(2) is the 3rd column.
 

Users who are viewing this thread

Back
Top Bottom