showing selected sub-from record in parent form

  • Thread starter BBC via AccessMonster.com
  • Start date
B

BBC via AccessMonster.com

I have a parent form that has full detail of a Registration record for one
selected Franchise (for editing purposes). Below I have a subform showing
all the registration records associated with the current selected franchise.
The records in the subform are linked to the parent by their FranchiseID so
selecting a Franchise (from a combobox) displays the associated records in
the subform. The Registration records have a normal autogenerated primary
key (not the FranchiseID which is the Franchise's primary). Fields are bound
to the parent form.
I want to be able to click on any one of the listed subform rows and have
that data appear in the top part of the form (and then preferably change
focus back to a field on the parent for editing). I have tried numerous
methods such as.
using the subform current event to try to find the associated record such as;
me.parent.recordset.FindFirst "[id]=" & ID (or me.parent!recordset.
FindFirst "[id]=" & ID)
me.parent!comments.setfocus
-or setting the subform ID to a field on the parent (works) then trying to
set focus back to that field on the parent form and using its gotfocus to do
a findfirst (ignores the setfocus from the subform)
etc.

Suggestions please
 
B

BBC via AccessMonster.com

Some clarification to the above post.
The sub-form in question is not a "separate" (loaded) form, it is a datasheet
view of the selected ("by" Franchise) Registration records that exists on the
bottom of mainform.
I am not sure how this affects references to "me." or "parent", etc. Maybe
this is part of the problem.
Also the bound fields on the main part of the form and those in the datasheet
have of course the same "names".
I have a parent form that has full detail of a Registration record for one
selected Franchise (for editing purposes). Below I have a subform showing
all the registration records associated with the current selected franchise.
The records in the subform are linked to the parent by their FranchiseID so
selecting a Franchise (from a combobox) displays the associated records in
the subform. The Registration records have a normal autogenerated primary
key (not the FranchiseID which is the Franchise's primary). Fields are bound
to the parent form.
I want to be able to click on any one of the listed subform rows and have
that data appear in the top part of the form (and then preferably change
focus back to a field on the parent for editing). I have tried numerous
methods such as.
using the subform current event to try to find the associated record such as;
me.parent.recordset.FindFirst "[id]=" & ID (or me.parent!recordset.
FindFirst "[id]=" & ID)
me.parent!comments.setfocus
-or setting the subform ID to a field on the parent (works) then trying to
set focus back to that field on the parent form and using its gotfocus to do
a findfirst (ignores the setfocus from the subform)
etc.

Suggestions please
 
B

BBC via AccessMonster.com

Solved this
Some clarification to the above post.
The sub-form in question is not a "separate" (loaded) form, it is a datasheet
view of the selected ("by" Franchise) Registration records that exists on the
bottom of mainform.
I am not sure how this affects references to "me." or "parent", etc. Maybe
this is part of the problem.
Also the bound fields on the main part of the form and those in the datasheet
have of course the same "names".
I have a parent form that has full detail of a Registration record for one
selected Franchise (for editing purposes). Below I have a subform showing
[quoted text clipped - 18 lines]
Suggestions please
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top