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_Fo rmat(Cancel As Integer, FormatCount As
Integer)
If Not IsNull(Controls ("txtCOMPANY"). Value) Then
Controls("txtCO MPANY").Visible = -1
Controls("txtCO MPANYADDRESS"). Visible = -1
Controls("lblCO MPANYADDRESS"). Visible = -1
Controls("lblCO MPANYADDRESS"). Value = "Company address:"
Controls("txtCO MPANYTELEPHONEN UMBER").Visible = -1
Controls("lblCO MPANYTELEPHONEN UMBER").Value = "Company Telephone
N:"
Controls("lblCO MPANYTELEPHONEN UMBER").Visible = -1
Controls("lblCo mpanyMobile").V isible = -1
Controls("txtCO MPANYMOBILENUMB ER").Visible = -1
Controls("lblCo mpanyMobile").V alue = "Company Mobile:"
Else
Controls("txtCO MPANY").Visible = 0
Controls("txtCO MPANYADDRESS"). Visible = 0
Controls("lblCO MPANYADDRESS"). Visible = 0
Controls("lblCO MPANYADDRESS"). Value = Null
Controls("txtCO MPANYTELEPHONEN UMBER").Visible = 0
Controls("lblCO MPANYTELEPHONEN UMBER").Visible = 0
Controls("lblCO MPANYTELEPHONEN UMBER").Value = Null
Controls("txtCO MPANYMOBILENUMB ER").Visible = 0
Controls("lblCo mpanyMobile").V isible = 0
Controls("lblCo mpanyMobile").V alue = 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
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_Fo rmat(Cancel As Integer, FormatCount As
Integer)
If Not IsNull(Controls ("txtCOMPANY"). Value) Then
Controls("txtCO MPANY").Visible = -1
Controls("txtCO MPANYADDRESS"). Visible = -1
Controls("lblCO MPANYADDRESS"). Visible = -1
Controls("lblCO MPANYADDRESS"). Value = "Company address:"
Controls("txtCO MPANYTELEPHONEN UMBER").Visible = -1
Controls("lblCO MPANYTELEPHONEN UMBER").Value = "Company Telephone
N:"
Controls("lblCO MPANYTELEPHONEN UMBER").Visible = -1
Controls("lblCo mpanyMobile").V isible = -1
Controls("txtCO MPANYMOBILENUMB ER").Visible = -1
Controls("lblCo mpanyMobile").V alue = "Company Mobile:"
Else
Controls("txtCO MPANY").Visible = 0
Controls("txtCO MPANYADDRESS"). Visible = 0
Controls("lblCO MPANYADDRESS"). Visible = 0
Controls("lblCO MPANYADDRESS"). Value = Null
Controls("txtCO MPANYTELEPHONEN UMBER").Visible = 0
Controls("lblCO MPANYTELEPHONEN UMBER").Visible = 0
Controls("lblCO MPANYTELEPHONEN UMBER").Value = Null
Controls("txtCO MPANYMOBILENUMB ER").Visible = 0
Controls("lblCo mpanyMobile").V isible = 0
Controls("lblCo mpanyMobile").V alue = 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
Comment