how to use query in textbox or label getting values from other table?

N

Nikko

hello,

i just built my Employee's form. The table EMPLOYEE has a primary key
id_firm that can link to the FIRM table.

I want to build a label or textbox in the Employee's From to display the
employee's firm name?
Is it possible to enter as a source the following query ?
(select firm_name from FIRM where id in (select id_firm from EMPLOYEE
where id=XXX))

thank you
 
G

Guest

The most straightforward way would be to create a query that links the
employees table and the firm table. Then you can return the firm_name in the
query and use it on your form.

HTH,
Barry
 
J

John Vinson

hello,

i just built my Employee's form. The table EMPLOYEE has a primary key
id_firm that can link to the FIRM table.

I want to build a label or textbox in the Employee's From to display the
employee's firm name?
Is it possible to enter as a source the following query ?
(select firm_name from FIRM where id in (select id_firm from EMPLOYEE
where id=XXX))

thank you

It's actually much easier than that.

Create a Query JOINING the Employee to the Firm table:

SELECT Employee.<whatever>, FIRM.firm_name
FROM Employee INNER JOIN Firm
ON Employee.id_firm = firm.id;


John W. Vinson[MVP]
 

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