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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
LLLLLL
"OOOOOOOOO |
Thread Tools | |
Display Modes | |
|
|