Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forms and Subforms help

Status
Not open for further replies.

automaticbaby

Technical User
Jan 16, 2002
45
US
I have a form with a subform that shows all the records in one table. I would like the form to show the record I select/highlight from the subform.

If it's possible, how would I go about having the form show the selected subform record? I think what I'm aiming for is having the selected record link to the text box in the form.

Thanks
 
As long as your main form keep its original master link field, you can show the selected record from your sub form in a textbox.
What you want is a bit like making the subform the master and vv but it can bedone.

Use the subforms OnCurrent event
You could have a checkbox on your main form that selects/deselects this option ie.

If YrMainFrm!SelYN=true then
YrMainFrm!TxtBox=Me!YrTxtFld &" " & Me!YrTxtFld2 etc.
end if

Herman
Say no to macros
 
Not sure if this is what your asking. In thread702-1193299 I posted some code that synched a main form with a subform. The main form was a single form view from a table, the subform was a continous form view of the same table. You can navigate in the subform, and it will choose the main form record or you can navigate in the main and it will go to the same record in the sub form.
 
Herman,

I'm not sure I understand what you mean with the original master link.

On the other hand, what you've described is exactly what I want, but I don't think I need the check box.

I've taken you code and adapted it, but I get an Object required error. This is what I got:

frmList![CardRef] = Me![Card Ref]

Is this what your code states?

MainForm!BoxInMainForm = SubForm!ColumnNameInSubForm


Alberto
 
Well forms/subforms as linked via the master/child fields normally some ID fields, but never mind.

frmlist!CardRef = Forms!YrMainForm!CardList
or
frmlist!CardRef = Forms!YrMainForm!YrSubForm.Form!CardList

Herman
Say no to macros
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top