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-False causes extra line on form

Status
Not open for further replies.

WWRA

Technical User
Apr 2, 2003
27
0
0
US
I'm a newbie, so be gentle ;>)

I have a form with a Group Header on which I print
a field called txtTitle, txtTitle.visible-true. This is determined based on whether or not the field txtbold is true or false. If txtbold is true, txtTitle is visible.

On the same form I have a detail area, also using the field
txtTitle, sometimes visible is true, other times it is set to false. The problem is that when visible=false, it creates a double space situation on the form. I assume it's still allocating space on the form even though visible=false and txtTitle doesn't appear.

I'm on a strict deadline with this project, so don't want to change my logic to fix this.

My question: "Is there any way to keep visible=false from causing a double space situtation?"

This is a real bummer since everything else is working great.

All help will be sincerely appreciated.

Thanks!

 
Hi Randy,
txtTitle.visible=True
txtTitle.visible=false
 
Yes, but how are you setting it? In the OnClick event of a button, in the Open event of the form, another way?


Randy
 
Randy,
First let me apologize, still trying to get the names down...obviously not doing a good job at it.

This is actually a report, not a form (sorry).
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 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

 
Try posting this question in the Reports forum. You should get better help there.


Randy
 
Thanks for your help, Randy.

I apologize for bothering you and others for the Forms Forum with a Report problem.
I'll take your advice and post on the Reports Forum.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top