Linking control to query, instead of forms record source

  • Thread starter Thread starter John Thomas
  • Start date Start date
J

John Thomas

I'm having trouble with the following Control linking to a query instead of
the forms recordsource, the form layout goes like this.
Main form name is: Splitter1
Sitting on that is a Tab Control named: Writing
The Tab page name is: TopicStudy

The Combo box name is: Chapter1
Bound ole object frame called: TopicStudy1

When I make my selection in the Combo box, which has as its source a query
called: StudiesQuery
I want the Control beneath it called: TopicStudy1, to go to the StudiesQuery
field called: Document(an msWord embedded field), of the selected record in
that combo box, identified by the field Ref3 on that query

Problem is that it is by default linked to the main form recordsource
instead of StudiesQuery, my following attempt has failed, and I need just
the single control TopicStudy1 to be linked to the StudiesQuery and respond
to its own navigation from the combo box of that same query, not the whole
form. The combo box is working, but the response to it below in AfterUpdate
is not, Thanks for any help?

Private Sub Chapter1_AfterUpdate()
Me.TopicStudy1.ControlSource = "[StudiesQuery].Document"
Me.RecordsetClone.FindFirst "[Ref3] = " & Me![Chapter1]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub



Thanks John
 
I would like to do that, but my Screen splitter won't resize subfroms, or at
least I cannot get it to, so I need to code it this way some how.

But if you know how I could get the following code to address my subform I
could do it that way.

This is my screen splitter code for a non-subform control to include in in
my resizing.
.RightControls.Add Me.TopicStudy1
 
Back
Top