On No Data in Report

mfaisalwarraich

New member
Local time
Today, 02:49
Joined
Oct 13, 2007
Messages
2
Hi,

well im not an expert of Access. i made a report in design view and then i added sub reports to it. i want a text box should appear if there is no record found in any subreports with "No Records Found".

i did this with each subreport alone. but when they are added into a report as subreport they are not even not visible if no record is there in subreport.
for each report (which are added as subreports in a report) i added the following code in On No Data event of the report:
where txtNoData is a text box whose visible property is set to no.

Me!txtNoData.Visible = True
Me![txtNoData] = "No Records Found"
Cancel = False

this code is working for me but only if i am opening report alone. i am looking for your help. please help me out how would i get rid of this problem? thank u.

Regards

mfaisalwarraich
 
mfaisalwarraich

Try doing a search of this forum for Dcount
If you count the records, of the query, the subreport is based upon and then display a message if it = 0.

Garry
 
thank u Garry for your reply. im not asking for a message to display through MsgBox. im asking for a textBox on the report with "No Records Founds".

please go through my question again. thank u :)
 
Try to add a textbox under your subreport that is your subreport will be above this text box that contains your message. With this when your subreport has no data, your message will be the one displayed, if your sub report has data, it covers the textbox.
 

Users who are viewing this thread

Back
Top Bottom