tutu
tutu

Reputation: 695

Displaying records in an unrelated subform access 2010

I'm in a pickle. This is probably quite easy but I just cannot figure it out.

2 Tables with columns:

tbl_indicators | tbl_targets
ind_id         | id
ind_name       | ind_id
               | year
               | comment1
               | comment2

I have got an unrelated subform on a form. On the subform I have 3 textboxes; tbl_indicators.ind_name, tbl_targets.comment1, tbl_targets.comment2. Users need to be able to edit the comments. The subform should contain all the names from tbl_indicators and linked to each name the comment textboxes. So for example, if tbl_indicators got 10 names, the subform should view 10 records. How can I do this?

Upvotes: 0

Views: 1317

Answers (2)

Fionnuala
Fionnuala

Reputation: 91336

The result of the discussion was a form along these lines. The main form has a subform for names, and a button to open a small form form the comments that are associated with each name. A name can have no comments or more than one comment. The button can be a macro or VBA:

DoCmd.OpenForm "FormName",,,"[ind_id]=" & [ind_id]

Form/subform line button

Upvotes: 1

Albert D. Kallal
Albert D. Kallal

Reputation: 48999

So this sub form is not a classic "child" table of the parent. However, this sub form is based on the above need displaying ing_name.

The simple solution then is to build a query that left joins in the tbl_indiciator column of in_name.

So just build a query like this:

enter image description here The above is a left join query since it may be possible that there no corresponding tbl_indicators record.

You continues sub form will thus look like this:

enter image description here

Upvotes: 0

Related Questions