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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subform won't display Query results

Status
Not open for further replies.

gaRed

MIS
Jun 17, 2002
18
US
I am having trouble getting the results of a select query to populate a text box in a subform. I can't figure out what I'm going wrong. The query deals with down production hours and is measured in military time. Part of the IIf statement in the select portion of the code is as follows:

IIf([DownStop]<[DownStart],(([DownStop])+1),([DownStop])) AS NewRestart, Sum([NewRestart]-[DownStart])*24*60 AS MinutesDown, Sum([NewReStart]-[DownStart])*24 AS DownTotal,

I am setting the Control Source of the box to &quot;MinutesDown&quot;. Executing the form returns #Name? in the text box instead of the results.
 
Are these three fields in a query or recordset? What exactly is in your Control Source property for that text box?
 
the three fields are in a query. the recordset for the box is 'MinutesDown'.
 
It seems not to like the idea of the sum of one calculation which is dependant on the result of another calculation in the same query. Does the query run ok and give you a value for minutes down? How about the down total?
 
It works fine as a query. Running it gives no problems. Total down and minutes down are separate, so removing or adding one shouldn't affect the other. I just can't figure this one out. Everything I see suggest that the subform should be working. :(
 
A shot in the dark: Create a new form, set its record source to the query, add one text box and set its control source (from the properties popup) to &quot;MinutesDown&quot;.

Basically though, it sounds like one of those ubiquitous typos.

Cheers, Bill
 
If it's not a typo, you might want to try doing the minutes down calculation on the form. Does the total down appear ok on the form?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top