Associated label will not grow/shrink stimulatingly as the text do

G

Guest

Greetings****
Why the associated label will not grow/shrink stimulatingly as the text
does? I have several text boxes that grow/shrink based on the amount of data,
I would ant the associated labels to shrink/grow as they do. How would I do
this? Please help?

Thank you, Adnan
 
S

strive4peace

Hi Adam,

instead of using labels, you could make the label caption
part of the field value. Do this in the RecordSource. For
example...

field --> Fieldname_: IIF(Isnull([field]),"","Label: " &
[field])

Another option is to make the labels invisible in code for
the controls that have no data

Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
 
G

Guest

Thank you, Crystal – I’m not that advances with access, therefore could you
point this out on where to paste this formula?

Should I change label to Tex then paste this “IIF(Isnull([field]),"","Label:
" &
[field])†on RecordSource or how?

Little bit more info please.

Reminder: what I want is, the label to grow/shrink when its associated filed
shirks, I want their frames/borders look alike on size.

Again, thank you for quick response,
Adnan, Computer science student, Kosovo :)


--
Please post all your inquiries on this community so we can all benefit -
Thank you!


strive4peace" <"strive4peace2006 at yaho said:
Hi Adnan,

instead of using labels, you could make the label caption
part of the field value. Do this in the RecordSource. For
example...

field --> Fieldname_: IIF(Isnull([field]),"","Label: " &
[field])

Another option is to make the labels invisible in code for
the controls that have no data

Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
Greetings****
Why the associated label will not grow/shrink stimulatingly as the text
does? I have several text boxes that grow/shrink based on the amount of data,
I would ant the associated labels to shrink/grow as they do. How would I do
this? Please help?

Thank you, Adnan
 
S

strive4peace

Hi Adnan,

since you didn't give any data example, I will make one up.

Lets say you are printing addresses and have a control name
= Address and you have set Address to Shrink and Grow

since the corresponding label will not Shrink and Grow, you
can do this:

include label caption with the control display

instead of making the ControlSource=Address, include the
label in the ControlSource

ControlSource --> IIF( Isnull([Address]), "", "Addresss: " &
[Address])



Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
 
D

Duane Hookom

I think you should remove the borders and use the Line Method in the On
Print event of the report section to draw the borders.

Assuming you have a text box "PR_DESC" that can grow or shrink. The label
next to it is "Label0" and you want to print a border around it the same
height as the grown PR_DESC text box. Enter code into the On Print event of
the report section:

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim lngHeight As Long
lngHeight = Me.PR_DESC.Height
Me.Line (Me.Label0.Left, Me.Label0.Top) _
-Step(Me.Label0.Width, lngHeight), , B
End Sub

If you have other controls, you may need to find the maximum height and draw
borders around all controls.
--
Duane Hookom
MS Access MVP

Adnan said:
Thank you, Crystal - I'm not that advances with access, therefore could
you
point this out on where to paste this formula?

Should I change label to Tex then paste this
"IIF(Isnull([field]),"","Label:
" &
[field])" on RecordSource or how?

Little bit more info please.

Reminder: what I want is, the label to grow/shrink when its associated
filed
shirks, I want their frames/borders look alike on size.

Again, thank you for quick response,
Adnan, Computer science student, Kosovo :)


--
Please post all your inquiries on this community so we can all benefit -
Thank you!


strive4peace" <"strive4peace2006 at yaho said:
Hi Adnan,

instead of using labels, you could make the label caption
part of the field value. Do this in the RecordSource. For
example...

field --> Fieldname_: IIF(Isnull([field]),"","Label: " &
[field])

Another option is to make the labels invisible in code for
the controls that have no data

Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
Greetings****
Why the associated label will not grow/shrink stimulatingly as the text
does? I have several text boxes that grow/shrink based on the amount of
data,
I would ant the associated labels to shrink/grow as they do. How would
I do
this? Please help?

Thank you, Adnan
 
G

Guest

Thank you Duane -You have answered my question but, of course I have some
more text boxes and labels that I have to have on report, so I was wondering
if you could help here, too.
When I try to add another text box a label I get following error.
http://adnani.8m.com/Sample1.JPG

What I want is this report:
http://adnani.8m.com/Sample2.JPG

Thank you very much │ Thank you Crystal, too. I find your help harder to
implement, again thank you!

Adnan

--
Please post all your inquiries on this community so we can all benefit -
Thank you!


Duane Hookom said:
I think you should remove the borders and use the Line Method in the On
Print event of the report section to draw the borders.

Assuming you have a text box "PR_DESC" that can grow or shrink. The label
next to it is "Label0" and you want to print a border around it the same
height as the grown PR_DESC text box. Enter code into the On Print event of
the report section:

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim lngHeight As Long
lngHeight = Me.PR_DESC.Height
Me.Line (Me.Label0.Left, Me.Label0.Top) _
-Step(Me.Label0.Width, lngHeight), , B
End Sub

If you have other controls, you may need to find the maximum height and draw
borders around all controls.
--
Duane Hookom
MS Access MVP

Adnan said:
Thank you, Crystal - I'm not that advances with access, therefore could
you
point this out on where to paste this formula?

Should I change label to Tex then paste this
"IIF(Isnull([field]),"","Label:
" &
[field])" on RecordSource or how?

Little bit more info please.

Reminder: what I want is, the label to grow/shrink when its associated
filed
shirks, I want their frames/borders look alike on size.

Again, thank you for quick response,
Adnan, Computer science student, Kosovo :)


--
Please post all your inquiries on this community so we can all benefit -
Thank you!


strive4peace" <"strive4peace2006 at yaho said:
Hi Adnan,

instead of using labels, you could make the label caption
part of the field value. Do this in the RecordSource. For
example...

field --> Fieldname_: IIF(Isnull([field]),"","Label: " &
[field])

Another option is to make the labels invisible in code for
the controls that have no data

Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*

Adnan wrote:
Greetings****
Why the associated label will not grow/shrink stimulatingly as the text
does? I have several text boxes that grow/shrink based on the amount of
data,
I would ant the associated labels to shrink/grow as they do. How would
I do
this? Please help?

Thank you, Adnan
 
D

Duane Hookom

You can't dim the same memory variable twice in one module.

I would make all the text boxes and label names consistent (txt0, txt1,
txt2,... lbl0, lbl1, lbl2,...)and then use code like:

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim lngHeight As Long
Dim intCtlNum As Integer
For intCtlNum = 0 To 1
lngHeight = Me("txt" & intCtlNum).Height
Me.Line (Me("lbl" & intCtlNum).Left, Me("lbl" & intCtlNum).Top) _
-Step(Me("lbl" & intCtlNum).Width, lngHeight), , B
Next
End Sub
--
Duane Hookom
MS Access MVP


Adnan said:
Thank you Duane -You have answered my question but, of course I have some
more text boxes and labels that I have to have on report, so I was
wondering
if you could help here, too.
When I try to add another text box a label I get following error.
http://adnani.8m.com/Sample1.JPG

What I want is this report:
http://adnani.8m.com/Sample2.JPG

Thank you very much ? Thank you Crystal, too. I find your help harder to
implement, again thank you!

Adnan

--
Please post all your inquiries on this community so we can all benefit -
Thank you!


Duane Hookom said:
I think you should remove the borders and use the Line Method in the On
Print event of the report section to draw the borders.

Assuming you have a text box "PR_DESC" that can grow or shrink. The label
next to it is "Label0" and you want to print a border around it the same
height as the grown PR_DESC text box. Enter code into the On Print event
of
the report section:

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim lngHeight As Long
lngHeight = Me.PR_DESC.Height
Me.Line (Me.Label0.Left, Me.Label0.Top) _
-Step(Me.Label0.Width, lngHeight), , B
End Sub

If you have other controls, you may need to find the maximum height and
draw
borders around all controls.
--
Duane Hookom
MS Access MVP

Adnan said:
Thank you, Crystal - I'm not that advances with access, therefore could
you
point this out on where to paste this formula?

Should I change label to Tex then paste this
"IIF(Isnull([field]),"","Label:
" &
[field])" on RecordSource or how?

Little bit more info please.

Reminder: what I want is, the label to grow/shrink when its associated
filed
shirks, I want their frames/borders look alike on size.

Again, thank you for quick response,
Adnan, Computer science student, Kosovo :)


--
Please post all your inquiries on this community so we can all
benefit -
Thank you!


:

Hi Adnan,

instead of using labels, you could make the label caption
part of the field value. Do this in the RecordSource. For
example...

field --> Fieldname_: IIF(Isnull([field]),"","Label: " &
[field])

Another option is to make the labels invisible in code for
the controls that have no data

Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*

Adnan wrote:
Greetings****
Why the associated label will not grow/shrink stimulatingly as the
text
does? I have several text boxes that grow/shrink based on the amount
of
data,
I would ant the associated labels to shrink/grow as they do. How
would
I do
this? Please help?

Thank you, Adnan
 
G

Guest

Hi Duane - It works great for lbl0, lbl1 and txt0, txt1 but it will not work
for the other lbls and txts, I’ve renamed them as instructed by you, lbl0,
lbl1, lbl2… and so on – and txt0, txt1, txt2….
Is there still anything you could help!

Thank you, Adnan :)

--
Please post all your inquiries on this community so we can all benefit -
Thank you!


Duane Hookom said:
You can't dim the same memory variable twice in one module.

I would make all the text boxes and label names consistent (txt0, txt1,
txt2,... lbl0, lbl1, lbl2,...)and then use code like:

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim lngHeight As Long
Dim intCtlNum As Integer
For intCtlNum = 0 To 1
lngHeight = Me("txt" & intCtlNum).Height
Me.Line (Me("lbl" & intCtlNum).Left, Me("lbl" & intCtlNum).Top) _
-Step(Me("lbl" & intCtlNum).Width, lngHeight), , B
Next
End Sub
--
Duane Hookom
MS Access MVP


Adnan said:
Thank you Duane -You have answered my question but, of course I have some
more text boxes and labels that I have to have on report, so I was
wondering
if you could help here, too.
When I try to add another text box a label I get following error.
http://adnani.8m.com/Sample1.JPG

What I want is this report:
http://adnani.8m.com/Sample2.JPG

Thank you very much ? Thank you Crystal, too. I find your help harder to
implement, again thank you!

Adnan

--
Please post all your inquiries on this community so we can all benefit -
Thank you!


Duane Hookom said:
I think you should remove the borders and use the Line Method in the On
Print event of the report section to draw the borders.

Assuming you have a text box "PR_DESC" that can grow or shrink. The label
next to it is "Label0" and you want to print a border around it the same
height as the grown PR_DESC text box. Enter code into the On Print event
of
the report section:

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim lngHeight As Long
lngHeight = Me.PR_DESC.Height
Me.Line (Me.Label0.Left, Me.Label0.Top) _
-Step(Me.Label0.Width, lngHeight), , B
End Sub

If you have other controls, you may need to find the maximum height and
draw
borders around all controls.
--
Duane Hookom
MS Access MVP

Thank you, Crystal - I'm not that advances with access, therefore could
you
point this out on where to paste this formula?

Should I change label to Tex then paste this
"IIF(Isnull([field]),"","Label:
" &
[field])" on RecordSource or how?

Little bit more info please.

Reminder: what I want is, the label to grow/shrink when its associated
filed
shirks, I want their frames/borders look alike on size.

Again, thank you for quick response,
Adnan, Computer science student, Kosovo :)


--
Please post all your inquiries on this community so we can all
benefit -
Thank you!


:

Hi Adnan,

instead of using labels, you could make the label caption
part of the field value. Do this in the RecordSource. For
example...

field --> Fieldname_: IIF(Isnull([field]),"","Label: " &
[field])

Another option is to make the labels invisible in code for
the controls that have no data

Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*

Adnan wrote:
Greetings****
Why the associated label will not grow/shrink stimulatingly as the
text
does? I have several text boxes that grow/shrink based on the amount
of
data,
I would ant the associated labels to shrink/grow as they do. How
would
I do
this? Please help?

Thank you, Adnan
 
G

Guest

Upsss….. just figured this out Duane – I did not know I had to change
“intCtlNum = 0 To 1†to “intCtlNum = 0 To 10†(10 is number of txts and lbls
I have, so everytime I add another txt or lbl then I’d have to change this
number, too)

If there was a bigger word then “Thank you†then I could defiantly use it
here :)

Thank you, Duane!
Adnan
Studnet

--
Please post all your inquiries on this community so we can all benefit -
Thank you!


Duane Hookom said:
You can't dim the same memory variable twice in one module.

I would make all the text boxes and label names consistent (txt0, txt1,
txt2,... lbl0, lbl1, lbl2,...)and then use code like:

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim lngHeight As Long
Dim intCtlNum As Integer
For intCtlNum = 0 To 1
lngHeight = Me("txt" & intCtlNum).Height
Me.Line (Me("lbl" & intCtlNum).Left, Me("lbl" & intCtlNum).Top) _
-Step(Me("lbl" & intCtlNum).Width, lngHeight), , B
Next
End Sub
--
Duane Hookom
MS Access MVP


Adnan said:
Thank you Duane -You have answered my question but, of course I have some
more text boxes and labels that I have to have on report, so I was
wondering
if you could help here, too.
When I try to add another text box a label I get following error.
http://adnani.8m.com/Sample1.JPG

What I want is this report:
http://adnani.8m.com/Sample2.JPG

Thank you very much ? Thank you Crystal, too. I find your help harder to
implement, again thank you!

Adnan

--
Please post all your inquiries on this community so we can all benefit -
Thank you!


Duane Hookom said:
I think you should remove the borders and use the Line Method in the On
Print event of the report section to draw the borders.

Assuming you have a text box "PR_DESC" that can grow or shrink. The label
next to it is "Label0" and you want to print a border around it the same
height as the grown PR_DESC text box. Enter code into the On Print event
of
the report section:

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim lngHeight As Long
lngHeight = Me.PR_DESC.Height
Me.Line (Me.Label0.Left, Me.Label0.Top) _
-Step(Me.Label0.Width, lngHeight), , B
End Sub

If you have other controls, you may need to find the maximum height and
draw
borders around all controls.
--
Duane Hookom
MS Access MVP

Thank you, Crystal - I'm not that advances with access, therefore could
you
point this out on where to paste this formula?

Should I change label to Tex then paste this
"IIF(Isnull([field]),"","Label:
" &
[field])" on RecordSource or how?

Little bit more info please.

Reminder: what I want is, the label to grow/shrink when its associated
filed
shirks, I want their frames/borders look alike on size.

Again, thank you for quick response,
Adnan, Computer science student, Kosovo :)


--
Please post all your inquiries on this community so we can all
benefit -
Thank you!


:

Hi Adnan,

instead of using labels, you could make the label caption
part of the field value. Do this in the RecordSource. For
example...

field --> Fieldname_: IIF(Isnull([field]),"","Label: " &
[field])

Another option is to make the labels invisible in code for
the controls that have no data

Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*

Adnan wrote:
Greetings****
Why the associated label will not grow/shrink stimulatingly as the
text
does? I have several text boxes that grow/shrink based on the amount
of
data,
I would ant the associated labels to shrink/grow as they do. How
would
I do
this? Please help?

Thank you, Adnan
 
D

Duane Hookom

You could automate this more but it probably isn't worth the hastle.

It does raise a red flag of normalization when I see a question or need for
something like this. I don't know about your situation. Your structure could
be completely normalized.

--
Duane Hookom
MS Access MVP

Adnan said:
Upsss... just figured this out Duane - I did not know I had to change
"intCtlNum = 0 To 1" to "intCtlNum = 0 To 10" (10 is number of txts and
lbls
I have, so everytime I add another txt or lbl then I'd have to change this
number, too)

If there was a bigger word then "Thank you" then I could defiantly use it
here :)

Thank you, Duane!
Adnan
Studnet

--
Please post all your inquiries on this community so we can all benefit -
Thank you!


Duane Hookom said:
You can't dim the same memory variable twice in one module.

I would make all the text boxes and label names consistent (txt0, txt1,
txt2,... lbl0, lbl1, lbl2,...)and then use code like:

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim lngHeight As Long
Dim intCtlNum As Integer
For intCtlNum = 0 To 1
lngHeight = Me("txt" & intCtlNum).Height
Me.Line (Me("lbl" & intCtlNum).Left, Me("lbl" & intCtlNum).Top) _
-Step(Me("lbl" & intCtlNum).Width, lngHeight), , B
Next
End Sub
--
Duane Hookom
MS Access MVP


Adnan said:
Thank you Duane -You have answered my question but, of course I have
some
more text boxes and labels that I have to have on report, so I was
wondering
if you could help here, too.
When I try to add another text box a label I get following error.
http://adnani.8m.com/Sample1.JPG

What I want is this report:
http://adnani.8m.com/Sample2.JPG

Thank you very much ? Thank you Crystal, too. I find your help harder
to
implement, again thank you!

Adnan

--
Please post all your inquiries on this community so we can all
benefit -
Thank you!


:

I think you should remove the borders and use the Line Method in the
On
Print event of the report section to draw the borders.

Assuming you have a text box "PR_DESC" that can grow or shrink. The
label
next to it is "Label0" and you want to print a border around it the
same
height as the grown PR_DESC text box. Enter code into the On Print
event
of
the report section:

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim lngHeight As Long
lngHeight = Me.PR_DESC.Height
Me.Line (Me.Label0.Left, Me.Label0.Top) _
-Step(Me.Label0.Width, lngHeight), , B
End Sub

If you have other controls, you may need to find the maximum height
and
draw
borders around all controls.
--
Duane Hookom
MS Access MVP

Thank you, Crystal - I'm not that advances with access, therefore
could
you
point this out on where to paste this formula?

Should I change label to Tex then paste this
"IIF(Isnull([field]),"","Label:
" &
[field])" on RecordSource or how?

Little bit more info please.

Reminder: what I want is, the label to grow/shrink when its
associated
filed
shirks, I want their frames/borders look alike on size.

Again, thank you for quick response,
Adnan, Computer science student, Kosovo :)


--
Please post all your inquiries on this community so we can all
benefit -
Thank you!


:

Hi Adnan,

instead of using labels, you could make the label caption
part of the field value. Do this in the RecordSource. For
example...

field --> Fieldname_: IIF(Isnull([field]),"","Label: " &
[field])

Another option is to make the labels invisible in code for
the controls that have no data

Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*

Adnan wrote:
Greetings****
Why the associated label will not grow/shrink stimulatingly as
the
text
does? I have several text boxes that grow/shrink based on the
amount
of
data,
I would ant the associated labels to shrink/grow as they do. How
would
I do
this? Please help?

Thank you, Adnan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top