Show a subtable's value in Label

  • Thread starter Thread starter Martin
  • Start date Start date
M

Martin

Hi,

in Access 2007, how to show a subtable's value in Label placed on a database
form (Form Design view)?

Database schema
------------------
Table A: AId, AData
Table B: BId, AId, BData

Questions
----------
Form for table A: What to type into Label.ControlSource property to show
BData (if more, show the one with highest AId; if none, show "not exists"
string)?

Form for table B: What to type into Label.ControlSource property to show
AData; if not exists, show "not exists" string?

Thank you in advance.
 
On Sun, 18 Jan 2009 12:21:01 -0800, Martin

I'm not following. It appears you have a 1:M relation between A and B,
and you then want to use a Label to show data on the Many-side.
Typically we use a subform control to show data on the many side. Is
that not appropriate for you?

-Tom.
Microsoft Access MVP
 
Hi,

so I need to provide live examples.

First case:
You have a table of customers (table A). Than, you have a table of phone
calls (table B). You have this table as a subform of from A. However, you
would like to highligh result (BData) of the very last call (first row sorted
by BId). So you place a label for it (because it's a read-only information)
and would like to bind the label to show the newest row's value from table B.

Second case:
You have a table of customers (table A). Than, you have a table of table of
possible customer personality. You place a combo box to edit the personality.
However, you would like to highlight the customer personality in the form
header. So you place a new label on the form header, choose appropriate
design, and would like to bind it to show the personality of the user (so it
needs to go to another linked table to gather the right value).

I hope that the user cases are meaningful.

Thank you for your tips on solutions.
 
Hi,

I just remembered that Label does not support binding. But it might be
TextBox or other meaningful control as well, which will show the read-only
data.

Martin
 
Back
Top