Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / February 2005

Tip: Looking for answers? Try searching our database.

Report font

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Annie - 27 Feb 2005 16:36 GMT
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
fredg - 27 Feb 2005 17:53 GMT
> Hi. I created a bunch of mailing labels.  Depending on
> what we are mailing out, we would want to change the font
[quoted text clipped - 7 lines]
> 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"
       
Signature

Fred
Please only reply to this newsgroup.
I do not reply to personal email.

Annie - 27 Feb 2005 20:40 GMT
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

>-----Original Message-----
>
[quoted text clipped - 45 lines]
>DoCmd.Close acForm, "OptionFormName"
>       
Stephm - 27 Feb 2005 21:14 GMT
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

>-----Original Message-----
>
[quoted text clipped - 45 lines]
>DoCmd.Close acForm, "OptionFormName"
>       
fredg - 28 Feb 2005 05:39 GMT
> And since I'm asking, could the user also choose the label
> size?  Embarrissingly, I created the report so long ago I
[quoted text clipped - 53 lines]
>>DoCmd.Close acForm, "OptionFormName"
>>       

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)

Signature

Fred
Please only reply to this newsgroup.
I do not reply to personal email.

Stephm - 28 Feb 2005 15:59 GMT
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

>-----Original Message-----
>
[quoted text clipped - 122 lines]
>The measurement is in twips, 1440 per inch, so a 1/2-inch height would
>be = int(0.5 * 1440)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.