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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|