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  

hide label in subreport within report



 
 
Thread Tools Display Modes
  #1  
Old December 7th, 2009, 05:20 PM posted to microsoft.public.access.reports
rbeach
external usenet poster
 
Posts: 48
Default hide label in subreport within report

I have a report which utilizes a subreport for the information. within the
subreport is a textbox named "InTol". If the textbox has "IN", I need to hide
a label named "InTolerance", if the textbox has "Out" I need the label
visible. I know the below code will work to make the label visible or not.

If Me!InTol = "OUT" Then
Me!InTolerance.Visible = True
Else
Me!InTolerance.Visible = False
End If

My question is where do put this code in the subreport so it will be read
for each record in the report
--
Rick
  #2  
Old December 7th, 2009, 05:35 PM posted to microsoft.public.access.reports
Dale Fye
external usenet poster
 
Posts: 2,651
Default hide label in subreport within report

Rick

Try the Format event of the section of the sub-report where the control is
located (probably in the detail section), but could be in a group header or
footer.

----
HTH
Dale



"rbeach" wrote:

I have a report which utilizes a subreport for the information. within the
subreport is a textbox named "InTol". If the textbox has "IN", I need to hide
a label named "InTolerance", if the textbox has "Out" I need the label
visible. I know the below code will work to make the label visible or not.

If Me!InTol = "OUT" Then
Me!InTolerance.Visible = True
Else
Me!InTolerance.Visible = False
End If

My question is where do put this code in the subreport so it will be read
for each record in the report
--
Rick

  #3  
Old December 7th, 2009, 06:33 PM posted to microsoft.public.access.reports
rbeach
external usenet poster
 
Posts: 48
Default hide label in subreport within report

I have tried placing this code everywhere, but this only sets to what the
first record is set to. If the first record is set to "Out" then all records
display the label. If the first record is set to "IN" then all the records
hide the label.
--
Rick


"Dale Fye" wrote:

Rick

Try the Format event of the section of the sub-report where the control is
located (probably in the detail section), but could be in a group header or
footer.

----
HTH
Dale



"rbeach" wrote:

I have a report which utilizes a subreport for the information. within the
subreport is a textbox named "InTol". If the textbox has "IN", I need to hide
a label named "InTolerance", if the textbox has "Out" I need the label
visible. I know the below code will work to make the label visible or not.

If Me!InTol = "OUT" Then
Me!InTolerance.Visible = True
Else
Me!InTolerance.Visible = False
End If

My question is where do put this code in the subreport so it will be read
for each record in the report
--
Rick

  #4  
Old December 7th, 2009, 07:07 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default hide label in subreport within report

I can't imagine why the suggestion didn't work if you used the On Format
event of the section containing the control.

However, you could probably do this without code by changing your label to a
text box with a control source of:
=IIf([InTol] = "OUT","Out of Tolerance" , Null)

--
Duane Hookom
Microsoft Access MVP


"rbeach" wrote:

I have tried placing this code everywhere, but this only sets to what the
first record is set to. If the first record is set to "Out" then all records
display the label. If the first record is set to "IN" then all the records
hide the label.
--
Rick


"Dale Fye" wrote:

Rick

Try the Format event of the section of the sub-report where the control is
located (probably in the detail section), but could be in a group header or
footer.

----
HTH
Dale



"rbeach" wrote:

I have a report which utilizes a subreport for the information. within the
subreport is a textbox named "InTol". If the textbox has "IN", I need to hide
a label named "InTolerance", if the textbox has "Out" I need the label
visible. I know the below code will work to make the label visible or not.

If Me!InTol = "OUT" Then
Me!InTolerance.Visible = True
Else
Me!InTolerance.Visible = False
End If

My question is where do put this code in the subreport so it will be read
for each record in the report
--
Rick

  #5  
Old December 7th, 2009, 07:49 PM posted to microsoft.public.access.reports
rbeach
external usenet poster
 
Posts: 48
Default hide label in subreport within report

Duane,

I have made the changes per your suggestion and this works. I still do not
unerstand why the code did not work in the On Format event.
--
Rick


"Duane Hookom" wrote:

I can't imagine why the suggestion didn't work if you used the On Format
event of the section containing the control.

However, you could probably do this without code by changing your label to a
text box with a control source of:
=IIf([InTol] = "OUT","Out of Tolerance" , Null)

--
Duane Hookom
Microsoft Access MVP


"rbeach" wrote:

I have tried placing this code everywhere, but this only sets to what the
first record is set to. If the first record is set to "Out" then all records
display the label. If the first record is set to "IN" then all the records
hide the label.
--
Rick


"Dale Fye" wrote:

Rick

Try the Format event of the section of the sub-report where the control is
located (probably in the detail section), but could be in a group header or
footer.

----
HTH
Dale



"rbeach" wrote:

I have a report which utilizes a subreport for the information. within the
subreport is a textbox named "InTol". If the textbox has "IN", I need to hide
a label named "InTolerance", if the textbox has "Out" I need the label
visible. I know the below code will work to make the label visible or not.

If Me!InTol = "OUT" Then
Me!InTolerance.Visible = True
Else
Me!InTolerance.Visible = False
End If

My question is where do put this code in the subreport so it will be read
for each record in the report
--
Rick

  #6  
Old December 7th, 2009, 08:51 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default hide label in subreport within report

I don't understand either. I would probably set a Break Point and step
through the code to determine what's going on.

--
Duane Hookom
Microsoft Access MVP


"rbeach" wrote:

Duane,

I have made the changes per your suggestion and this works. I still do not
unerstand why the code did not work in the On Format event.
--
Rick


"Duane Hookom" wrote:

I can't imagine why the suggestion didn't work if you used the On Format
event of the section containing the control.

However, you could probably do this without code by changing your label to a
text box with a control source of:
=IIf([InTol] = "OUT","Out of Tolerance" , Null)

--
Duane Hookom
Microsoft Access MVP


"rbeach" wrote:

I have tried placing this code everywhere, but this only sets to what the
first record is set to. If the first record is set to "Out" then all records
display the label. If the first record is set to "IN" then all the records
hide the label.
--
Rick


"Dale Fye" wrote:

Rick

Try the Format event of the section of the sub-report where the control is
located (probably in the detail section), but could be in a group header or
footer.

----
HTH
Dale



"rbeach" wrote:

I have a report which utilizes a subreport for the information. within the
subreport is a textbox named "InTol". If the textbox has "IN", I need to hide
a label named "InTolerance", if the textbox has "Out" I need the label
visible. I know the below code will work to make the label visible or not.

If Me!InTol = "OUT" Then
Me!InTolerance.Visible = True
Else
Me!InTolerance.Visible = False
End If

My question is where do put this code in the subreport so it will be read
for each record in the report
--
Rick

  #7  
Old December 8th, 2009, 02:12 PM posted to microsoft.public.access.reports
Dale Fye
external usenet poster
 
Posts: 2,651
Default hide label in subreport within report

Can you copy the code from the sub-forms code module and paste it here.
Maybe we can pick-up on something.

----
HTH
Dale



"rbeach" wrote:

Duane,

I have made the changes per your suggestion and this works. I still do not
unerstand why the code did not work in the On Format event.
--
Rick


"Duane Hookom" wrote:

I can't imagine why the suggestion didn't work if you used the On Format
event of the section containing the control.

However, you could probably do this without code by changing your label to a
text box with a control source of:
=IIf([InTol] = "OUT","Out of Tolerance" , Null)

--
Duane Hookom
Microsoft Access MVP


"rbeach" wrote:

I have tried placing this code everywhere, but this only sets to what the
first record is set to. If the first record is set to "Out" then all records
display the label. If the first record is set to "IN" then all the records
hide the label.
--
Rick


"Dale Fye" wrote:

Rick

Try the Format event of the section of the sub-report where the control is
located (probably in the detail section), but could be in a group header or
footer.

----
HTH
Dale



"rbeach" wrote:

I have a report which utilizes a subreport for the information. within the
subreport is a textbox named "InTol". If the textbox has "IN", I need to hide
a label named "InTolerance", if the textbox has "Out" I need the label
visible. I know the below code will work to make the label visible or not.

If Me!InTol = "OUT" Then
Me!InTolerance.Visible = True
Else
Me!InTolerance.Visible = False
End If

My question is where do put this code in the subreport so it will be read
for each record in the report
--
Rick

  #8  
Old December 8th, 2009, 02:13 PM posted to microsoft.public.access.reports
Dale Fye
external usenet poster
 
Posts: 2,651
Default hide label in subreport within report

Did you put the code in the Format event of the sub-form, or the main form?

What version of Access are you using?

----
Dale



"rbeach" wrote:

I have tried placing this code everywhere, but this only sets to what the
first record is set to. If the first record is set to "Out" then all records
display the label. If the first record is set to "IN" then all the records
hide the label.
--
Rick


"Dale Fye" wrote:

Rick

Try the Format event of the section of the sub-report where the control is
located (probably in the detail section), but could be in a group header or
footer.

----
HTH
Dale



"rbeach" wrote:

I have a report which utilizes a subreport for the information. within the
subreport is a textbox named "InTol". If the textbox has "IN", I need to hide
a label named "InTolerance", if the textbox has "Out" I need the label
visible. I know the below code will work to make the label visible or not.

If Me!InTol = "OUT" Then
Me!InTolerance.Visible = True
Else
Me!InTolerance.Visible = False
End If

My question is where do put this code in the subreport so it will be read
for each record in the report
--
Rick

 




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:53 AM.


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