Form Values based on other table values

G

Guest

I have got a form which has combo box and shows EMP NO and EMP NAME linked to
table EMP. It stores EMP NO in it. Is there way I can add text box which
(A) stores EMP NAME when i SELECT EMPNO in combo box.
(B) displays EMP NAME when i select EMPNO in combo box.

In form, if user fills particular field, the next field stores/display
values which is arrived from other table. Eg if user fills Product Code, Next
field ie product name, searches product code from Product table(seperate from
current form table) and shows product name.
 
A

Allen Browne

Sandy, this is a really bad idea. One of the most basic goals in designing a
relational database is NOT to store related values like that.

You can *display* those values in your form very easily without storing
them. You can just set the Column Widths property of your combo to:
0
so that the first column is not visible and it shows the text.

Alternatively, you can create a query that uses both tables, and then drag
the [Emp Name] field from the Employee table into the grid. Then use this
query as the RecordSource for your form or report, and you can have a text
box showing the name.
 

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