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

Report query issue 1

Status
Not open for further replies.

robinsql

Programmer
Aug 2, 2002
236
IE
Hi,
I am running a report from a VB application where I create the SQL query. I need all of the info below but I also need the recordcount passed into the report, somewhere in this query. The recordcount info must be contained within the query below so I can populate a field on my report. Can anyone help me with this?

Any help gratefully received!

SELECT tblCalendar.Date,
tblPupil.Forename, tblPupil.Surname, tblPupil.Address_Line1, tblPupil.Address_Line2, tblPupil.Address_Line3, tblPupil.Class
From tblCalendar, tblPupil
WHERE (((tblCalendar.Date)
IN (SELECT [Date] FROM tblCalendar
WHERE tblCalendar.[Date]>=#2003/01/14#
AND tblCalendar.[Date]<=#2003/04/22#
AND tblCalendar.Description = 'SCH')
AND (tblCalendar.Date)
NOT IN
(SELECT [Date] FROM tblTimes WHERE tblTimes.FacilStuID ='00-0041')) AND ((tblPupil.FacilStuID)='00-0041'))
 
Can you just put a textbox in your Report Header or Footer with a Control Source set to
=Count(*)

That will probably give you what you want.

Paul
 
Hi Paul,
I did try that but, when I did it gave me an error. The textbox displays the following... #Error

Any idea what I can do to remedy this?
 
Make sure it's in the Report Header or Report Footer. If it's in the Page Header or Footer you will get that error.

Paul
 
I see my problem. I have it in the page header as opposed to the report header. Is there any way I can get this value into the page header?
 
You would have to put a textbox in the Report Header or Footer, set it's visible property to No and then put a textbox in the PageHeader that has a Control Source

=NameofTextboxInReportHeader/Footer


Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top