Subform not displaying

tjones

Registered User.
Local time
Yesterday, 17:21
Joined
Jan 17, 2012
Messages
199
I have a form (CourseTaken) that has a subform (UnitTotal). Everything is working except that the subform "detail fields" will not display until all three fields have an entry though they do save the information. The other problem is that the unittotal "footer field" will not display the total until all three fields contain a value.

all three fields are based on different queries (which is why the subform) with the control source as an overriding query UnitTotalAll which contains the three subqueries.

I tried putting the fields on the main form and using DLookup but could never get it to work. (see queries forum http://www.access-programmers.co.uk/forums/showthread.php?t=233324) using this:
'display the total credits for Required courses
Me!UnitRequired = DLookup("[UnitRequired]", "[qryUnitTotalRequired]", "[CourseStatus]='Completed-Required' AND [790ID]=" & [790ID])
'display the total credits for Core courses
Me!UnitCore = DLookup("[UnitCore]", "[qryUnitTotalCore]", "[CourseStatus]='Completed-Core' AND [790ID]=" & [790ID])
'display the total credits for Content courses
Me!UnitContent = DLookup("[UnitContent]", "[qryUnitTotalContent]", "[CourseStatus]='Completed-Content' AND [790ID]=" & [790ID])

'display the total credits for GPH Minor
Me!UnitTotal = DLookup("[UnitTotal]", "[qryUnitTotalRequired]", "[CourseStatus]=' ' AND [790ID]=" & [790ID])



How can I get the subform to display all the time? and the total to display when any one of the three has a value?
 
Last edited:
The solution was found. Put the fields on the main form as unbound text fields and in the control souce reference the query as the control source with this. Thank You boblarson!

=Nz(Dlookup("[TotalCreditsReq]", "qryUnitTotalRequired"), "")
 

Users who are viewing this thread

Back
Top Bottom