Re: Problem with Report code

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi Duane tried your second suggestion and got a prompt box for the name of
the report and Access changed the control source to this
=IIf([rptCReDriving Licence].[Report].[HasData],Null,"Former Label Caption")

Notice the extra square brackets that have appeared???

Any ideas?
Thanks
Tony
"Duane Hookom" <duanehookom@xxxxxxxxxxxxxxxxxx> wrote in message
news:9F3E8726-4A44-445F-9F25-AE60CC9A19A3@xxxxxxxxxxxxxxxx
Try
Me.lblnoinfo.Visible = Not Me.[rptCReDriving Licence].Report.HasData

You might also want to can the code and use a text box rather than label.
Set the control source to:
=IIf([rptCReDriving Licence].Report.HasData, Null,"Former Label Caption")


--
Duane Hookom
Microsoft Access MVP


"Tony Williams" wrote:

Here is my code
Private Sub Report_Activate()
If Me![rptCReDriving Licence].Report.Recordset.RecordCount = 0 Then
Me.lblnoinfo.Visible = False
Else
Me.lblnoinfo.Visible = True
End If
Me.Refresh
End Sub
I have a main report with a number of subreports. in the above example if
the rptCREDriving Licence has no data I want lblnoinfo (which is an
unbound
label) to appear in its place. However it doesn't work. can anyone see
why?
Thanks
Tony





.



Relevant Pages

  • Re: how to hide a empty txtbox and show a label??
    ... Why not just change the Control Source of the text box to: ... The report is based on a join query from 2 tables, one table "MasterData" contains the people and "Jobs" contains the various information about the jobs ... Private Sub Report_Open ...
    (microsoft.public.access.reports)
  • Re: Opening report from a form field as parameter
    ... Thanks Duane, ... Alain ... >> Private Sub btnGenerateReport_Click ... >> and here is the code I use on my report ...
    (microsoft.public.access.reports)
  • Re: Column Width
    ... I added three text boxes in the Report Header section: ... Control source: ... Private Sub Detail_Format(Cancel As Integer, ... Dim intTotChars As Integer ...
    (microsoft.public.access.reports)
  • Re: Performing a subquery in a textbox control on a report
    ... Thanks a lot, Duane. ... report grouping integrity in this was the ultimate goal/obstacle. ... I started out trying dcount, but since it wasn't maintaining the group the ... > The entire above code could be replaced with a control source in the text ...
    (microsoft.public.access.reports)
  • Re: Null Value
    ... Could you provide the exact expression you use as the control source? ... >> The IIfexpression should be in the main report, ... >> Duane Hookom ... I have the IIF statement in my sub report. ...
    (microsoft.public.access.reports)