Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
564 views
in Technique[技术] by (71.8m points)

ms access - Display many to many relationship in continuous form

I can't figure out how to display a column that has many value for the same record in a continuous form

I got 3 tables

SalesCall
SalesCallId | etc..

Mill
MillId | name...

SalesCallMills    <------ Junction table 
Id | SalesCallId | MillID 

the basic design for a many to many relationship.

When it's a simple form, I'm used to do a list and change the control source for the current ID with a SQL query.

What's the common practice to display this in a continuous form?

This was the form before when only 1 mill was possible.

enter image description here

I thought I could concat the mills, but it will be hard to read and it will be way to long.

So I thought about a list but I don't think it's possible to change the control source for each record.

Also, good to mention that this is read-only. It's not for adding or editing. The form to enter data is already made. And I think that one mill per record is not an option cause it would really confuse the user.

What's the proper way to display a multi value column with my database design?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This is a form with correlated subforms.

The two forms are synchronized via the link child and master fields:

Link Master Fields: Forms!Form7![SalesCall Subform].Form.SaleID
Link Child Fields: SalesCallId

And a little code in the Current Event of subform #1

Private Sub Form_Current()
Me.Parent.[SalesCallMills subform].Form.Requery
End Sub

Selecting a line in subform #1 displays the relevant detail lines in subform #2.

correlated subform

It should not be difficult to add suitable information on such things as mill name to the general outline.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...