Help with listing subform controls

kdt

Registered User.
Local time
Today, 13:42
Joined
Apr 5, 2006
Messages
48
Hi

I want to create a text box on my Mainform with a list of StudyNumber values from the subform. The subform can contain many records. Putting the following into the source for the textbox:

=[Subform].[Form]![StudyNumber]

gives me only the first subform recordset. Is there a way that I can change this so that all the linked StudyNumber values are being shown. I was thinking about using a loop, but got very badly stuck, please help!
 
You don't need to use VBA for that; just create a query that pulls all StudyNumbers and base your listbox's rowsource (not recordsource) on that query.
 
thanks for the reply, but this is returning all StudyNumbers in the table, is there a way to limit this to those that are in the subform being viewed? The subform is linked to the mainform by a master child link. Thanks a bunch!
 
Then add the chid field into the rowsource's query. Can't remember if this is sufficient on its own or if you need to add a criteria for child field to match what you have on your form; try and experiment.
 

Users who are viewing this thread

Back
Top Bottom