Linking 2 sub-forms (1 Viewer)

lawman

New member
Local time
Today, 15:33
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: 13

MajP

You've got your good things, and you've got mine.
Local time
Today, 10:33
Joined
May 21, 2018
Messages
4,520
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

error reading drive A:
Local time
Today, 23:33
Joined
May 7, 2009
Messages
11,536
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: 18

MajP

You've got your good things, and you've got mine.
Local time
Today, 10:33
Joined
May 21, 2018
Messages
4,520
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