Linking 2 sub-forms (1 Viewer)

lawman

New member
Local time
Today, 00:52
Joined
Dec 8, 2020
Messages
15
1. As we stated you need to add case ID to the first forms query. Makes is a whole lot simpler.
2. The second subform is linked by CaseID and not Case name
sorry for not understanding this fully, but....

1. i've added CaseID in recordsource to the left subform in below db same as you did, but the vba still gives an error that it can't find CaseID member.

1608340665575.png

1608340578559.png




2. With Arrnel, his master txtCaseID is only using this code =[frmKeydates].[Form]![CaseName]. It refers to left subform. When I use exactly same code, it gives me different result.

1608340739345.png
 

Attachments

  • BCMdec17-majp.accdb
    1.6 MB · Views: 100

MajP

You've got your good things, and you've got mine.
Local time
Yesterday, 20:52
Joined
May 21, 2018
Messages
8,463
If you change it to me!CaseID it will work. The first way is correct Me.Caseid, but it is a long story since you added it to the query after the fact. In fact if you add the field caseid on to the form and save it, it will work with me.caseid. Then you can actually delete it. You hit a very rare case that cause me. not to work and me! to work.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 08:52
Joined
May 7, 2009
Messages
19,169
i abandone the Link Master/Child fields.
instead i used qryCase as rowsource of frmCase.
qryCase is a parameter query.
i Requery frmCase on the Load event of frmKeyCase and
on the Current event of frmKeyDates.

the result is much faster than Link Master/Child fields.
 

Attachments

  • BCMdec17-arnel.accdb
    2.4 MB · Views: 116

MajP

You've got your good things, and you've got mine.
Local time
Yesterday, 20:52
Joined
May 21, 2018
Messages
8,463
That is interesting. Although talking fractions of seconds, it is still noticeably faster. I might have to rethink one of my current dbs that uses a lot of linked subforms.
 

Users who are viewing this thread

Top Bottom