471,119 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,119 software developers and data experts.

Shrink fields by conditional formatting

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
Jun 27 '08 #1
3 1978
"Galka" <ga****@mail.ruwrote in message
news:fb**********************************@34g2000h sf.googlegroups.com...
>
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?
Is the Group Header's "Can shrink" property also set to "Yes"?

Keith.
www.keithwilby.com

Jun 27 '08 #2
On May 15, 2:45*pm, "Keith Wilby" <h...@there.comwrote:
"Galka" <gal...@mail.ruwrote in message

news:fb**********************************@34g2000h sf.googlegroups.com...
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?

Is the Group Header's "Can shrink" property also set to "Yes"?

Keith.www.keithwilby.com
Keith
How ingeniously simple! No, it was not. Now it is and shrinks all
right. Thank you.
Galina
Jun 27 '08 #3
"Galka" <ga****@mail.ruwrote in message
news:b4**********************************@k13g2000 hse.googlegroups.com...

You're welcome, glad I could help.

Keith.
www.keithwilby.com

Jun 27 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Bradley | last post: by
8 posts views Thread by Dimitri Furman | last post: by
5 posts views Thread by Andrew Chanter | last post: by
1 post views Thread by GGerard | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.