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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visible.True causes double spacing on report 2

Status
Not open for further replies.

WWRA

Technical User
Apr 2, 2003
27
0
0
US
Report problem, see script & description of problem below, please. The problem seems to be with the txtTitle field.

Is there any way to have a visible=false not allow for the space to print the field.

The problem occurs in the GroupHeader0 section. Even though I put txtTitle.visible=False, it still makes room for the txtTitle on the report, thus creating a double space, which creates a problem on the report. My GroupHeader prints, double space occurs,followed by the single spaced detail lines associated with the GroupHeader. After the GroupHeader prints, I just need all the detail lines to print, no double space between the GroupHeader and the detail lines. After all the detail lines print, a single space occurs then another GroupHeader prints, followed by a double space, then the detail lines, etc.
Script Follows:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If txtBoldName = 0 Then 'If Bold is no
txtDetailTitle.Visible = True
txtTitle.FontBold = 0
txtDetailLocation.Visible = True
txtDetailLocation.FontBold = 0
txtDetailPhone.Visible = True
txtDetail.Visible = True
Else
txtDetailTitle.Visible = False 'If Bold is Yes
txtTitle.FontBold = 0
txtDetailLocation.Visible = False
txtDetailLocation.FontBold = 0
txtDetailPhone.Visible = False
txtDetail.Visible = False
End If

End Sub

Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
'If Bold Name is true, print some fields in BOLD
'If Commissioner title, do not print since it's printed in the Report Header
If txtBoldName = -1 And txtTitle <> "Commissioner" Then
txtTitle.FontBold = 1
txtCommissionerHeader.FontBold = 1
txtCommissionerHeader.Visible = True
txtTitle.Visible = True
txtLocation.FontBold = 1
txtLocation.Visible = True
txtPhone.Visible = True
'Chr (13) & Chr(10)
'Chr (13) & Chr(10)
'Chr (13) & Chr(10)
Else
txtTitle.FontBold = 0
txtCommissionerHeader.FontBold = 0
txtCommissionerHeader.Visible = False
txtTitle.Visible = False
txtLocation.FontBold = 0
txtLocation.Visible = False
txtPhone.Visible = False
End If

End Sub
 
Have you tried set the can shrink of the section to Yes. Also, you might want to set some of the controls' heights to .01 or something and play with it.

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]
[blue]Ask me about my grandson, get a grand answer.[/blue]
 
dhookom,
Thx for the suggestions. But, still no luck.

I'm really hoping someone can help me solve this.
Otherwise, I'll have to start over and change tables,logic, etc to get the report fixed.

Again, thx for your help.
 
Have you thought about changing the visible = false to make it blank and then set the CanShrink property to yes and see what happens

Hope this helps
Hymn
 
How about creating another group header based on the same field as you existing group header. You can then use similar code to make the entire group heading invisible or cancel its formatting.

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]
[blue]Ask me about my grandson, get a grand answer.[/blue]
 
dhookom & hymn,
Thx for these great ideas. I'll try these asap and let you know how it goes. If you think of anything else, please let me know.

:>)

 
dhookom & hymn,

I gave both of you a star! Building on your suggestions,
I've finally solved my print problem.

THANKS! for your help.



 
Good and thank you

Hope this helps
Hymn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top