473,396 Members | 2,038 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 2098
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: John Kreps | last post by:
(acc 2002) I've got six unbound text boxes on a subform that has a white background. Each of those six boxes has an expression that when true, will change its background from white to another...
4
by: Bradley | last post by:
I have an A2000 database in which I have a continuous form with a tick box. There is also a text box with a conditional format that is based on the expression , if it's true then change the...
8
by: Dimitri Furman | last post by:
Given: Access 2002/2003 A subform in datasheet or continuous view, placed on a tab page (this last may or may not matter) Conditional formatting applied to some controls on the subform - format...
2
by: Cro | last post by:
Dear Access Developers, I am developing a form with 'default view' set to "continuous forms". I am suffering with a problem I can't yet see a solution too. Each record has many fields. Two...
5
by: Andrew Chanter | last post by:
Does anyone know a way you can use conditional formatting to create a banded style view as is commonly seen on the internet. (In othe words the first record appears on a gray background, the 2nd...
2
by: Jozef | last post by:
Hello, I have a report that contains a memo field that can contain quite a bit of information. There are actually a couple of fields like this. When I use can grow / can shrink, the report...
1
by: GGerard | last post by:
Hello Is there a way to use a variable in the Conditional Formatting of a Textbox? Example : I want the background of a textbox in a continuous form to change color when the value of...
4
by: midlothian | last post by:
Hello, I have conditional formatting set up on a subform based on a calculated value in the underlying query. For instance, if Sales are >$1000, the query displays "Yes," otherwise it displays...
10
by: afromanam | last post by:
Regards, Please help What I'm trying to do is this: (and I can't use reports since I must export to Excel) I export some queries to different tabs in an excel workbook I then loop through...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.