G
Guest
I have a main form named user_Match.
It has three subform containers:
sub_BUSays with source object form named sub_match_BUSays
sub_RptSays with source object form named sub_match_ReportSays
sub_BTSays with source object form named sub_match_BTSays
sub_match_BUSays has a field called BU_BT_Portfolio_ID.
sub_match_ReportSays has a field called MRE_PortfolioID.
sub_match_BTSays has a field called BT_Portfolio_ID.
The portfolio id is a unique 10 digit number stored as a string.
I want to use the parent form to identify incorrect portfolio id's
in the BUSays and ReportSays subforms.
I would like to be able to doubleclick the portfolio id field
in any of the three subforms in order to display the record
with a matching portfolio id in the other two subforms.
However, I don't want to filter down to just that record.
Each subforms recordset needs to be available so I can search
or navigate to find the correct record in the case of no match
or an incorrect match.
The DoCmd.OpenForm with OnOpen Bookmark doesn't seem to work since
it will open separate instances of the subforms.
I have been try to adjust the code suggested by Wayne-I-M in
"how to select record in the subform and to show it in the main form"
which uses setfocus, findfirst, and bookmark within the initiating
event to change the record on the parent. But I can't seem to get
the references to the 2nd and 3rd subforms right when I try to modify it for
for this application.
With this code I get an error message that says:
"invalid method in an expression" but it doesn't tell me which
expression
Forms!user_Match!sub_RptSays.Form!MRE_ProjectID = _
Forms!user_Match!sub_BUsays.Form!BU_BT_Portfolio_ID
Forms!user_Match!sub_RptSays.Form.SetFocus
Set rst = Me("sub_RptSays").Form.RecordsetClone
rst.FindFirst "MRE_PortfolioID = " & _
Forms!user_Match!sub_BUsays.Form!BU_BT_Portfolio_ID
Me("sub_BUSays").Form.Bookmark = rst.Bookmark
If I use the referential syntax from
http://www.mvps.org/access/forms/frm0031.htm
so that the code looks like this:
Me!sub_RptSays.Form!MRE_ProjectID = Me.BU_BT_Portfolio_ID
Me!sub_RptSays.Form!MRE_ProjectID.SetFocus
Set rst = Me("sub_BUSays").Form.RecordsetClone
rst.FindFirst "sub_RptSays = " & Me.BU_BT_Portfolio_ID
Me("sub_BUSays").Form.Bookmark = rst.Bookmark
I get an error trap message that says it can't find the field
sub_RptSays
If I swap the container names for the actual names of the subforms
I get an error trap message that says it can't find the field
sub_match_ReportSays
I have tried adding square brackets and several other permutations
but nothing seems to work.
Does anyone have any ideas? What am I doing wrong?
Thanks,
It has three subform containers:
sub_BUSays with source object form named sub_match_BUSays
sub_RptSays with source object form named sub_match_ReportSays
sub_BTSays with source object form named sub_match_BTSays
sub_match_BUSays has a field called BU_BT_Portfolio_ID.
sub_match_ReportSays has a field called MRE_PortfolioID.
sub_match_BTSays has a field called BT_Portfolio_ID.
The portfolio id is a unique 10 digit number stored as a string.
I want to use the parent form to identify incorrect portfolio id's
in the BUSays and ReportSays subforms.
I would like to be able to doubleclick the portfolio id field
in any of the three subforms in order to display the record
with a matching portfolio id in the other two subforms.
However, I don't want to filter down to just that record.
Each subforms recordset needs to be available so I can search
or navigate to find the correct record in the case of no match
or an incorrect match.
The DoCmd.OpenForm with OnOpen Bookmark doesn't seem to work since
it will open separate instances of the subforms.
I have been try to adjust the code suggested by Wayne-I-M in
"how to select record in the subform and to show it in the main form"
which uses setfocus, findfirst, and bookmark within the initiating
event to change the record on the parent. But I can't seem to get
the references to the 2nd and 3rd subforms right when I try to modify it for
for this application.
With this code I get an error message that says:
"invalid method in an expression" but it doesn't tell me which
expression
Forms!user_Match!sub_RptSays.Form!MRE_ProjectID = _
Forms!user_Match!sub_BUsays.Form!BU_BT_Portfolio_ID
Forms!user_Match!sub_RptSays.Form.SetFocus
Set rst = Me("sub_RptSays").Form.RecordsetClone
rst.FindFirst "MRE_PortfolioID = " & _
Forms!user_Match!sub_BUsays.Form!BU_BT_Portfolio_ID
Me("sub_BUSays").Form.Bookmark = rst.Bookmark
If I use the referential syntax from
http://www.mvps.org/access/forms/frm0031.htm
so that the code looks like this:
Me!sub_RptSays.Form!MRE_ProjectID = Me.BU_BT_Portfolio_ID
Me!sub_RptSays.Form!MRE_ProjectID.SetFocus
Set rst = Me("sub_BUSays").Form.RecordsetClone
rst.FindFirst "sub_RptSays = " & Me.BU_BT_Portfolio_ID
Me("sub_BUSays").Form.Bookmark = rst.Bookmark
I get an error trap message that says it can't find the field
sub_RptSays
If I swap the container names for the actual names of the subforms
I get an error trap message that says it can't find the field
sub_match_ReportSays
I have tried adding square brackets and several other permutations
but nothing seems to work.
Does anyone have any ideas? What am I doing wrong?
Thanks,