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 / Forms Programming / June 2007

Tip: Looking for answers? Try searching our database.

Change the default font used on form and report

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Smiley - 19 Jun 2007 19:30 GMT
Hi,

Would anyone give me some guide line how to change the default font used in
Form and Report in MSAccess 2003. I went thought the tabs in Tools -->
Options but none seem to work.

I don't like the default font used at present which is MS Sans Serif size 8.
I would like to use another font which is bolder and larger sizes. I don't
want to change the size and font from the property for every form and
report. Is there a way to do it before I create the form and report so that
I would save a bit of work ?

Thank for your help in advance.
Douglas J. Steele - 19 Jun 2007 19:49 GMT
Select the text box from the tool bar, but don't copy it anywhere. Go to the
Properties window: it should say "Default Text Box". Set the properties for
what you want as the defaults. All future use of the text box control will
now have the properties you defined. Do the same for any other controls you
want.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Hi,
>
[quoted text clipped - 9 lines]
>
> Thank for your help in advance.
Smiley - 20 Jun 2007 11:18 GMT
Hi Douglas,

Thank you for the info.

But this only work on a form. I.e. I start a new form or modify an existing
form in Design view. After I done the amendment, there after Whatever fields
I create will be on the amended font and size. But when I start a new form
either in design mode or using the Wizard, the default font and size are
back to MS Sans Serif size 8 again. What I have not done right to get this
result. What I really want is basically change the basic default to other
font and sizes so that whether I am using design view or form wizard, I will
get the newly amended font and size. Is this achievable ?

Regards,

Smiley

> Select the text box from the tool bar, but don't copy it anywhere. Go to
> the Properties window: it should say "Default Text Box". Set the
[quoted text clipped - 15 lines]
>>
>> Thank for your help in advance.
Marshall Barton - 19 Jun 2007 21:27 GMT
>Would anyone give me some guide line how to change the default font used in
>Form and Report in MSAccess 2003. I went thought the tabs in Tools -->
[quoted text clipped - 5 lines]
>report. Is there a way to do it before I create the form and report so that
>I would save a bit of work ?

For existing text boxes, you can write a little code to loop
through the Form/Report documents and their controls
collection to set the properties.  If you do this, be aware
that when you use a larger font, you may need larger text
boxes to display the values.

Signature

Marsh
MVP [MS Access]

Smiley - 20 Jun 2007 19:16 GMT
Hi Marsh,

Do you have an example to start me off. I am not too familiar with coding

Many thanks in advance,

>>Would anyone give me some guide line how to change the default font used
>>in
[quoted text clipped - 14 lines]
> that when you use a larger font, you may need larger text
> boxes to display the values.
Marshall Barton - 20 Jun 2007 21:04 GMT
>Do you have an example to start me off. I am not too familiar with coding

Here's some code that I tweek to make global changes like
you want:

Dim dbCur As Database
Dim doc As Document
Dim ctl As Control

On Error GoTo ErrHandler

   Set dbCur = CurrentDb
   
   For Each doc In dbCur.Containers("Forms").Documents
       DoCmd.OpenForm doc.Name, acDesign
       For Each ctl In Forms(doc.Name)
           ctl.FontName = "Arial"
           ctl.FontSize = 10
       Next ctl
       DoCmd.Close acForm, doc.Name, acSaveYes
   Next doc

   For Each doc In dbCur.Containers("Reports").Documents
       DoCmd.OpenReport doc.Name, acDesign
       For Each ctl In Reports(doc.Name)
           ctl.FontName = "Arial"
           ctl.FontSize = 10
       Next ctl
       DoCmd.Close acReport, doc.Name, acSaveYes
   Next doc
   
ExitHere:
   Set dbCur = Nothing
   Exit Sub
   
ErrHandler:
   Select Case Err.Number
   Case 438   'Property does not exist
       Resume Next
   Case Else
       MsgBox Err.Number & " - " & Err.Description
       Resume ExitHere
   End Select
End Sub

Signature

Marsh
MVP [MS Access]

Smiley - 21 Jun 2007 13:19 GMT
Hi Marshall,

Thank you for the code. Shall try it out but it may be some days before I
can give you an update.

Have a good day,

>>Do you have an example to start me off. I am not too familiar with coding
>
[quoted text clipped - 40 lines]
>    End Select
> End Sub
 
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.