Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subreport has data 1

Status
Not open for further replies.

jw5107

Technical User
Jan 20, 2004
294
US
I have a report with a sub-report. I need to make a text box bold on the main report when the sub-report has data.
Any examples or suggestions...?
Not sure how to set this up...???
Thanks in advance..!
jw5107
 
How about:
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.[[i]subreport Name[/i]].Report.HasData Then
    Me.txtText.FontWeight = 700
Else
    Me.txtText.FontWeight = 400
End If
End Sub
 
Remou,

I have tried your suggestion... I get an error stating that it cannot support this object.. and on de-bug it highlights
Me.Tail.FontWeight = 700

This is what I am working with:
If Me.PartsReqdMAIN.Report.HasData Then
Me.Tail.FontWeight = 700
Else
Me.Tail.FontWeight = 400
End If

Any other suggestions..???
Thanks for the quick response..!!
jw5107
 
Whst happens if you manually sent the font weight to bold?
 
Remou,
Don't want the font to be bold all the time - only when the subreport has data.....
jw5107
 
Is "Tail" the name of the text box or is it just a field name in your report's record source? What section did you add your code into?

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
dhookum,

"Tail" is the name of the textbox as well as a field name in the reports record source. I placed the code in the Detail Sections - on format event..

Do you think you can take a look at thread702-1272806 - when you get a chance...????
Need some mad skills to help me out with that one...!!
Thanks in advance for all of your help!!
jw5107
 
Regarding the other thread, I don't know anything about Stephen's solution and don't really want to :) I guess if this was something that was significnt to my users I might take a look.

Did you get the original issue in this thread sorted out?

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
dhookum,

Thanks.

No I didn't get it sorted out. Still get the error message I stated earlier....

jw5107
 
Change the name of the control to "txtTail" and change your code to see what happens. Also, have you compiled your code
Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
dhookum,
Got it...!!
Thank you very much...!!!
jw5107
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top