Report font

  • Thread starter Thread starter Annie
  • Start date Start date
A

Annie

Hi. I created a bunch of mailing labels. Depending on
what we are mailing out, we would want to change the font
(fancy party invite with fancy party font, every-day
communication with "every-day font".

Is there a way to ask the user what font type they want to
use when printing the labels? How would I do that?
Details are very nice- thanks!

Thanks,
Annie
 
Hi. I created a bunch of mailing labels. Depending on
what we are mailing out, we would want to change the font
(fancy party invite with fancy party font, every-day
communication with "every-day font".

Is there a way to ask the user what font type they want to
use when printing the labels? How would I do that?
Details are very nice- thanks!

Thanks,
Annie

Several ways. Here's one:
Create an unbound form.
Add an option group with as many options as you wish to give the user.
Label each option with the name of a Font (or occasion).
Add a command button.
Set it's Click event to:
Me.Visible = False

Code the Report's open event:

DoCmd.OpenForm "OptionFormName", , , , , acDialog
Dim TheFont as String
Select Case forms!OptionFormName!OptionGroupName
Case is = 1
TheFont = "Arial"
Case is = 2
TheFont = "Times New Roman"
Case is = 3
TheFont = "Nuptial BT"
Case Else
TheFont = "Script MT Bold"
End Select

Dim c as control
For each c in Me.Section(0).Controls
If TypeOf c is TextBox Then
c.FontName = TheFont
End If
Next

Note: Make sure you spell each font name above correctly.

Code the Report's Close event:
DoCmd.Close acForm, "OptionFormName"
 
Fabulous Fred! Thank you- that worked just right! I
appreciate the the step-by-step action.

Question: Can I also let the user decide the font size
along with the font itself? Because once you let them
have something, they want more! So I'd set up another
option group. I'm not sure what to do with the click event
to capture both as Me!Visible = False since it would be
nice if the user can just click one button.

I'm not sure how to do a second select case.

Thanks, Annie
 
And since I'm asking, could the user also choose the label
size? Embarrissingly, I created the report so long ago I
can't even remember how I chose the label in the first
place! Thanks, Steph
 
And since I'm asking, could the user also choose the label
size? Embarrissingly, I created the report so long ago I
can't even remember how I chose the label in the first
place! Thanks, Steph

In regards to your other reply to my previous post about including a
user option to select the font size as well as the font name.
Just use the same form. Add another Option Group with the possible
Font sizes. Code the Report Open event as follows:

DoCmd.OpenForm "OptionFormName", , , , , acDialog
Dim TheFont as String
Dim intSize as Integer
Select Case forms!OptionFormName!FontNameOptionGroupName
Case is = 1
TheFont = "Arial"
Case is = 2
TheFont = "Times New Roman"
Case is = 3
TheFont = "Nuptial BT"
Case Else
TheFont = "Script MT Bold"
End Select

Select Case forms!OptionFormName!FontSizeOptionGroupName
Case is = 1
intSize = 10
Case is = 2
intSize = 12
Case else
intSize = 8
End select

Dim c as control
For each c in Me.Section(0).Controls
If TypeOf c is TextBox Then
c.FontName = TheFont
c.FontSize = intSize
End If
Next


I have no idea, however, what you mean by 'Label size' in this post.
Do you mean the Avery Label sheet number, i.e. 8160 to 8213?
It would be easier to simply create a second label report, and using
another option group, open that report rather than this one, as it's
not simply changing the size of the label, but also their horizontal
placement and the size of the detail section.

Do you mean to alter the height of a label control at runtime?
Not really recommended for mailing labels, as the size of the paper
label is fixed.
But you can experiment, if you wish.
The above is using Text controls, not label controls.
You could add another Option Group to the form.
Use another Select Case, similar to the above.

Dim intHeight as Integer
Select Case forms!etc. as above
Case is = 1
intHeight = Int(0.33 * 1440)
Case is = 2
IntHeight = Int(0.5 * 1440)
etc.
End Select

Then add to the coding as above:

c.Height = intHeight

The measurement is in twips, 1440 per inch, so a 1/2-inch height would
be = int(0.5 * 1440)
 
Thanks- I didn't realize that changing the Avery sheet
size was so complicated. I didn't even know what
a "twip" was! Thanks, Steph
 
Back
Top