A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Problem with Report code



 
 
Thread Tools Display Modes
  #1  
Old August 31st, 2007, 02:26 PM posted to microsoft.public.access.reports
Tony Williams
external usenet poster
 
Posts: 349
Default Problem with Report code

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


  #2  
Old August 31st, 2007, 02:40 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Problem with Report code

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



  #3  
Old August 31st, 2007, 03:39 PM posted to microsoft.public.access.reports
Tony Williams
external usenet poster
 
Posts: 349
Default Problem with Report code

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" wrote in message
...
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





  #4  
Old August 31st, 2007, 05:40 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Problem with Report code

Confirm the name of the report control. Is the textbox in the same section of
the report as the subreport?

--
Duane Hookom
Microsoft Access MVP


"Tony Williams" wrote:

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" wrote in message
...
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






  #5  
Old August 31st, 2007, 05:53 PM posted to microsoft.public.access.reports
Tony Williams
external usenet poster
 
Posts: 349
Default Problem with Report code

Thanks Duane. An incorrect name reference. I'd changed the name of the
report but didn't change the name of the subreport to match. Is it senility
or does everyone stare at something for a whole day and not notice the
obvious?
Thanks again Sorry for posting a question when the answer was right under my
nose!
Tony
"Duane Hookom" wrote in message
...
Confirm the name of the report control. Is the textbox in the same section
of
the report as the subreport?

--
Duane Hookom
Microsoft Access MVP


"Tony Williams" wrote:

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" wrote in message
...
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








  #6  
Old August 31st, 2007, 07:34 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Problem with Report code

It's Friday before a long weekend (at least here in the States) so you are
granted one such episode. You have now used yours up ;-)

--
Duane Hookom
Microsoft Access MVP


"Tony Williams" wrote:

Thanks Duane. An incorrect name reference. I'd changed the name of the
report but didn't change the name of the subreport to match. Is it senility
or does everyone stare at something for a whole day and not notice the
obvious?
Thanks again Sorry for posting a question when the answer was right under my
nose!
Tony
"Duane Hookom" wrote in message
...
Confirm the name of the report control. Is the textbox in the same section
of
the report as the subreport?

--
Duane Hookom
Microsoft Access MVP


"Tony Williams" wrote:

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" wrote in message
...
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









  #7  
Old September 1st, 2007, 01:12 PM posted to microsoft.public.access.reports
Tony Williams
external usenet poster
 
Posts: 349
Default Problem with Report code

"Long weekend"? I dream of those and I'm supposed to be retired!!!!
Regards
Tony
"Duane Hookom" wrote in message
...
It's Friday before a long weekend (at least here in the States) so you are
granted one such episode. You have now used yours up ;-)

--
Duane Hookom
Microsoft Access MVP


"Tony Williams" wrote:

Thanks Duane. An incorrect name reference. I'd changed the name of the
report but didn't change the name of the subreport to match. Is it
senility
or does everyone stare at something for a whole day and not notice the
obvious?
Thanks again Sorry for posting a question when the answer was right under
my
nose!
Tony
"Duane Hookom" wrote in message
...
Confirm the name of the report control. Is the textbox in the same
section
of
the report as the subreport?

--
Duane Hookom
Microsoft Access MVP


"Tony Williams" wrote:

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" wrote in message
...
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












  #8  
Old September 7th, 2007, 10:44 AM posted to microsoft.public.access.reports
NOTICIAS
external usenet poster
 
Posts: 4
Default LLLLLL


"OOOOOOOOO


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:31 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.