Hello
Environment: Windows XP, MS Access 2003.
I'd like - in a report - to save space , when there is no company
data.
When there is, I print out company name, address, telephone number and
mobile - 4 lines. When there is no company data, these 4 lines are
made invisible by the following code:
Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As
Integer)
If Not IsNull(Controls("txtCOMPANY").Value) Then
Controls("txtCOMPANY").Visible = -1
Controls("txtCOMPANYADDRESS").Visible = -1
Controls("lblCOMPANYADDRESS").Visible = -1
Controls("lblCOMPANYADDRESS").Value = "Company address:"
Controls("txtCOMPANYTELEPHONENUMBER").Visible = -1
Controls("lblCOMPANYTELEPHONENUMBER").Value = "Company Telephone
N:"
Controls("lblCOMPANYTELEPHONENUMBER").Visible = -1
Controls("lblCompanyMobile").Visible = -1
Controls("txtCOMPANYMOBILENUMBER").Visible = -1
Controls("lblCompanyMobile").Value = "Company Mobile:"
Else
Controls("txtCOMPANY").Visible = 0
Controls("txtCOMPANYADDRESS").Visible = 0
Controls("lblCOMPANYADDRESS").Visible = 0
Controls("lblCOMPANYADDRESS").Value = Null
Controls("txtCOMPANYTELEPHONENUMBER").Visible = 0
Controls("lblCOMPANYTELEPHONENUMBER").Visible = 0
Controls("lblCOMPANYTELEPHONENUMBER").Value = Null
Controls("txtCOMPANYMOBILENUMBER").Visible = 0
Controls("lblCompanyMobile").Visible = 0
Controls("lblCompanyMobile").Value = Null
End If
End Sub
The bound text fields shrink, when there is no data and "Can Shrink"
is set to Yes.
In an attempt to shrink labels I have made unbound text fields instead
of labels and set "Can Shrink" to Yes. I also assign Null to these
text fields, - as you see in the code. (The names have prefix lbl, but
they are text fields.) Despite of all these, they do not shrink and
there are empty places, which occupy quite a bit of space.
If you know how to make unbound text fields to shrink, please could
you let me know?
Thank you.
Galkas