Conditional Point Size

A

Andy

Stephen/Marsh;

Have one more obstacle.

In one situation and only one situation.

The txtControl to be justified is on page 2 of a report. Meaning data on
page one, a Page Break, and then the Control.

Named all of the Controls the same so it was easy to Copy/Paste all the code
from one to another and pare out excessess,
EG: TO Justi8

At first thought pared out too much. No.
Finally added a txtContol to page 1 and left the txtControl on page 2. The
Control on Page 1 worked, Page 2 Control didn't.

Even used ControlSource =[txtMemo1] to txtMemo2. Didn't work either.

Any Suggestions or ideas?

Andy

Stephen Lebans said:
Look again at the source code behind the sample reports. You have to
declare a seperate instance of the JustiClass for EACH TextBox control
you want to justify.

Dim Justi1 As New clsJustifyText
Dim Justi2 As New clsJustifyText

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Call Justi1.fRecordSection(Me, Me.txtTestmemo, PrintCount)
Call Justi2.fRecordSection(Me, Me.txtTestMemo2, PrintCount)
End Sub

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


Andy said:
Marsh/Stephen;

Getting Odd behavior.

The report prints to a "Label". It contains 8 controls, 4 on the upper
portion, 4 on the lower.

The fTextHeight works for all of them, when the JustiDirect is added for all
the controls the Upper 4 are blank.

Used:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Call Justi1.fRecordDetail(Me, "txtProdDescript1", PrintCount)
Call Justi1.fRecordDetail(Me, "txtProdDescript2", PrintCount)
Call Justi1.fRecordDetail(Me, "txtProdDescript3", PrintCount)
Call Justi1.fRecordDetail(Me, "txtProdDescript4", PrintCount)
Call Justi1.fRecordDetail(Me, "txtProdDescript5", PrintCount)
Call Justi1.fRecordDetail(Me, "txtProdDescript6", PrintCount)
Call Justi1.fRecordDetail(Me, "txtProdDescript7", PrintCount)
Call Justi1.fRecordDetail(Me, "txtProdDescript8", PrintCount)

End Sub
Tested it by Remming out last 4 and the upper 4 controls text reappears.

Any ideas?

Andy
PS. Don't know if this is any help but this is also included on the Detail
on Format Event:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim intFS As Integer

For intFS = 14 To 8 Step -1
Me.txtProdDescript1.FontSize = intFS
Me.txtProdDescript2.FontSize = intFS
Me.txtProdDescript3.FontSize = intFS
Me.txtProdDescript4.FontSize = intFS
Me.txtProdDescript5.FontSize = intFS
Me.txtProdDescript6.FontSize = intFS
Me.txtProdDescript7.FontSize = intFS
Me.txtProdDescript8.FontSize = intFS

If fTextHeight(Me.txtProdDescript1) < Me.txtProdDescript1.Height Then
Exit For
If fTextHeight(Me.txtProdDescript2) < Me.txtProdDescript2.Height Then
Exit For
If fTextHeight(Me.txtProdDescript3) < Me.txtProdDescript3.Height Then
Exit For
If fTextHeight(Me.txtProdDescript4) < Me.txtProdDescript4.Height Then
Exit For
If fTextHeight(Me.txtProdDescript5) < Me.txtProdDescript5.Height Then
Exit For
If fTextHeight(Me.txtProdDescript6) < Me.txtProdDescript6.Height Then
Exit For
If fTextHeight(Me.txtProdDescript7) < Me.txtProdDescript7.Height Then
Exit For
If fTextHeight(Me.txtProdDescript8) < Me.txtProdDescript8.Height Then
Exit For
Next intFS
End Sub

"Stephen Lebans"
wrote in message news:[email protected]...
Justidirect issue:

1) As per the documentation, the original TextBox control's Font color
must be set to WHITE.

2) Certain Postscript Printer Drivers will not work with JustiDirect.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


Marsh;

Thank You.

The ftxtHeight works and works correctly. Incorporated Lebans code.

It is more than is needed and when I learn more I will pare some of it
out.

Right now am also trying to incorporate Lebans JustiDirect into the
Report's
code also. It's "almost" working.

Text is repeating twice in the rpt's control. (Text displayed on top
of
text), Once Justified the other is not.

Believe it has something to do with the functions calling the printer.

Thank You for all Your Help!!!

Andy

Andy wrote:
The TxtBox height on the Report is 2.625". Plenty of room for
multiple
lines.

Did try lebans.com fTxtHeight. One is for Forms only, another
increases/decreases the height of the txtBox in the Report. The
box
height
cannot exceed 2.625"


Oh bleep!! Dumb, dumb, dumb, I had a line of code in the
wrong place! Dumb, dumb . . .

For intFS = 14 To 8 Step -1
Me.txtProdDescript.FontSize = intFS
If fTextHeight(Me.txtProdDescript) _
< Me.txtProdDescript.Height Then Exit For
Next intFS

Make sure you're using the TextHeightWidth download at
http://www.lebans.com/textwidth-height.htm
which works fine for reports too.
--
Marsh
MVP [MS Access]



Marsh Your answer seems to be more versital, but it still goes
directly
to
the lowest FontSize:

Dim intFS As Integer
' With txtProdDescript
' .FontName = "ARIAL"
' End With
' Tried the above because the code below changes the Font
that is
normally used.
' It didn't work either

For intFS = 14 To 8 Step -1
If TextHeight(Me.txtProdDescript) <
Me.txtProdDescript.Height
Then
Exit
For
' Greater Than stays at the largest FontSize

' For intFS = 14 To 8 Step -1
' If TextHeight(Me.txtProdDescript) >
Me.txtProdDescript.Height
Then
Exit
For
' Less Than Goes directly to Smallest FontSize

' Even reversed it.
' For intFS = 8 To 14 Step 1
' If TextHeight(Me.txtProdDescript) <
Me.txtProdDescript.Height
Then
Exit
For
' Less Than goes directly to the smallest FontSize

' For intFS = 8 To 14 Step 1
' If TextHeight(Me.txtProdDescript) >
Me.txtProdDescript.Height
Then
Exit
For
' Greater Than goes directly to the largest FontSize

"Marshall Barton" wrote
Your test statistics imply that the text box height is not
tall enough for even one line, please double check that.

I also see that you are not using Stephen Lebans fTextHeight
function, but have elected to use the built in TextHeight
method. The built in method has many flaws when used for
this purpose and, while I would not expect the results you
are seeing, I definitely expect it to fail to meet your
needs.
 
A

Andy

Stephen;

Thank You for the compliment.

Wanted You to know that before I posted the original question had already
read 3-1,100 + - page books.

Searched Office Help Screens, VBA help screens for a dictionary full of word
combinations.

Spent Weeks, and I mean Weeks, searching for the answer at MSFT's support
sites, and even searched Yours and other MVP sites for an answer.

With Your site didn't realize that the answer was there. Had tunnel vision
for "Justified Text" and "Font Size"

Did go back to the indexes of the 3 books within the last few days and
nothing comes close.

Even Called Microsoft and informed them that I wasn't happy with the search
results. The tech tried to a search for something simple and even he
couldn't find the answer. Also sent 2 E-Mails to (e-mail address removed).

Thank God for Bill Gates my kids have shoes.

Thank God for Stephen Lebans and Marshall Barton, my kids will have food.

Andy

Stephen Lebans said:
Look again at the source code behind the sample reports. You have to
declare a seperate instance of the JustiClass for EACH TextBox control
you want to justify.

Dim Justi1 As New clsJustifyText
Dim Justi2 As New clsJustifyText

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Call Justi1.fRecordSection(Me, Me.txtTestmemo, PrintCount)
Call Justi2.fRecordSection(Me, Me.txtTestMemo2, PrintCount)
End Sub

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


Andy said:
Marsh/Stephen;

Getting Odd behavior.

The report prints to a "Label". It contains 8 controls, 4 on the upper
portion, 4 on the lower.

The fTextHeight works for all of them, when the JustiDirect is added for all
the controls the Upper 4 are blank.

Used:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Call Justi1.fRecordDetail(Me, "txtProdDescript1", PrintCount)
Call Justi1.fRecordDetail(Me, "txtProdDescript2", PrintCount)
Call Justi1.fRecordDetail(Me, "txtProdDescript3", PrintCount)
Call Justi1.fRecordDetail(Me, "txtProdDescript4", PrintCount)
Call Justi1.fRecordDetail(Me, "txtProdDescript5", PrintCount)
Call Justi1.fRecordDetail(Me, "txtProdDescript6", PrintCount)
Call Justi1.fRecordDetail(Me, "txtProdDescript7", PrintCount)
Call Justi1.fRecordDetail(Me, "txtProdDescript8", PrintCount)

End Sub
Tested it by Remming out last 4 and the upper 4 controls text reappears.

Any ideas?

Andy
PS. Don't know if this is any help but this is also included on the Detail
on Format Event:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim intFS As Integer

For intFS = 14 To 8 Step -1
Me.txtProdDescript1.FontSize = intFS
Me.txtProdDescript2.FontSize = intFS
Me.txtProdDescript3.FontSize = intFS
Me.txtProdDescript4.FontSize = intFS
Me.txtProdDescript5.FontSize = intFS
Me.txtProdDescript6.FontSize = intFS
Me.txtProdDescript7.FontSize = intFS
Me.txtProdDescript8.FontSize = intFS

If fTextHeight(Me.txtProdDescript1) < Me.txtProdDescript1.Height Then
Exit For
If fTextHeight(Me.txtProdDescript2) < Me.txtProdDescript2.Height Then
Exit For
If fTextHeight(Me.txtProdDescript3) < Me.txtProdDescript3.Height Then
Exit For
If fTextHeight(Me.txtProdDescript4) < Me.txtProdDescript4.Height Then
Exit For
If fTextHeight(Me.txtProdDescript5) < Me.txtProdDescript5.Height Then
Exit For
If fTextHeight(Me.txtProdDescript6) < Me.txtProdDescript6.Height Then
Exit For
If fTextHeight(Me.txtProdDescript7) < Me.txtProdDescript7.Height Then
Exit For
If fTextHeight(Me.txtProdDescript8) < Me.txtProdDescript8.Height Then
Exit For
Next intFS
End Sub

"Stephen Lebans"
wrote in message news:[email protected]...
Justidirect issue:

1) As per the documentation, the original TextBox control's Font color
must be set to WHITE.

2) Certain Postscript Printer Drivers will not work with JustiDirect.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


Marsh;

Thank You.

The ftxtHeight works and works correctly. Incorporated Lebans code.

It is more than is needed and when I learn more I will pare some of it
out.

Right now am also trying to incorporate Lebans JustiDirect into the
Report's
code also. It's "almost" working.

Text is repeating twice in the rpt's control. (Text displayed on top
of
text), Once Justified the other is not.

Believe it has something to do with the functions calling the printer.

Thank You for all Your Help!!!

Andy

Andy wrote:
The TxtBox height on the Report is 2.625". Plenty of room for
multiple
lines.

Did try lebans.com fTxtHeight. One is for Forms only, another
increases/decreases the height of the txtBox in the Report. The
box
height
cannot exceed 2.625"


Oh bleep!! Dumb, dumb, dumb, I had a line of code in the
wrong place! Dumb, dumb . . .

For intFS = 14 To 8 Step -1
Me.txtProdDescript.FontSize = intFS
If fTextHeight(Me.txtProdDescript) _
< Me.txtProdDescript.Height Then Exit For
Next intFS

Make sure you're using the TextHeightWidth download at
http://www.lebans.com/textwidth-height.htm
which works fine for reports too.
--
Marsh
MVP [MS Access]



Marsh Your answer seems to be more versital, but it still goes
directly
to
the lowest FontSize:

Dim intFS As Integer
' With txtProdDescript
' .FontName = "ARIAL"
' End With
' Tried the above because the code below changes the Font
that is
normally used.
' It didn't work either

For intFS = 14 To 8 Step -1
If TextHeight(Me.txtProdDescript) <
Me.txtProdDescript.Height
Then
Exit
For
' Greater Than stays at the largest FontSize

' For intFS = 14 To 8 Step -1
' If TextHeight(Me.txtProdDescript) >
Me.txtProdDescript.Height
Then
Exit
For
' Less Than Goes directly to Smallest FontSize

' Even reversed it.
' For intFS = 8 To 14 Step 1
' If TextHeight(Me.txtProdDescript) <
Me.txtProdDescript.Height
Then
Exit
For
' Less Than goes directly to the smallest FontSize

' For intFS = 8 To 14 Step 1
' If TextHeight(Me.txtProdDescript) >
Me.txtProdDescript.Height
Then
Exit
For
' Greater Than goes directly to the largest FontSize

"Marshall Barton" wrote
Your test statistics imply that the text box height is not
tall enough for even one line, please double check that.

I also see that you are not using Stephen Lebans fTextHeight
function, but have elected to use the built in TextHeight
method. The built in method has many flaws when used for
this purpose and, while I would not expect the results you
are seeing, I definitely expect it to fail to meet your
needs.
 

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