How to change all fonts for an access database?

  • Thread starter Thread starter Min
  • Start date Start date
M

Min

Hi, there:
I just copied an access database to my computer, opened it, but the original
fonts is not well displayed, I need change all fonts to one that can be
correctly displayed on my computer.
Where should I start to do so?

Thanks!

Min
 
Min said:
Hi, there:
I just copied an access database to my computer, opened it, but the original
fonts is not well displayed, I need change all fonts to one that can be
correctly displayed on my computer.
Where should I start to do so?

Thanks!

Min

Here is a piece of rubbish code that was kicking around the office:

Sub fixup_fontName()
'Aim: To change fonts in all control to "Tahoma" where the text size is
< 12. Does not change the size for label though.
'8454143 yellow
'16776960 blue

On Error Resume Next
Dim db As Database
Dim frm As Form
Dim i As Integer, j As Integer
Dim iFrmCount As Integer
Dim sFrmName As String
Dim ctl As Control

Set db = CodeDb()
iFrmCount = db.Containers("forms").Documents.Count
For i = 0 To iFrmCount - 1
sFrmName = db.Containers("forms").Documents(i).Name
DoCmd.OpenForm sFrmName, acDesign
Set frm = Forms(sFrmName)
If frm.Cycle = 0 Then frm.Cycle = 1 'change 'all records' to
'current record'
For j = 0 To 2
If frm.Section(j).BackColor = 12632256 Then
frm.Section(j).BackColor = -2147483633
Next j
For Each ctl In frm.Controls
'If (ctl.ControlType = acTextBox) Or (ctl.ControlType =
acComboBox) Then
If (ctl.ControlType = acTextBox) Or (ctl.ControlType = acComboBox)
Or (ctl.ControlType = acOptionGroup) Or (ctl.ControlType =
acBoundObjectFrame) Or (ctl.ControlType = acListBox) Or (ctl.ControlType =
acComboBox) Or (ctl.ControlType = acSubform) Or (ctl.ControlType =
acObjectFrame) Or (ctl.ControlType = acPageBreak) Or (ctl.ControlType =
acTabCtl) Then
If ctl.BackColor = 16776960 Then ctl.BackColor = 8454143
ctl.AllowAutoCorrect = False
ctl.FontName = "Tahoma" '2003/09/23 dlg
If (ctl.FontSize < 12) And (ctl.FontSize <> 8) Then
MsgBox frm.Name & "." & ctl.Name & vbCrLf & vbCrLf & "Font
Size is " & ctl.FontSize
End If
ElseIf ctl.ControlType = acLabel Then
ctl.FontName = "Tahoma" '2003/09/23 dlg
If (ctl.FontSize < 12) And (ctl.FontSize <> 8) Then
ctl.FontSize = 8
MsgBox frm.Name & "." & ctl.Name & vbCrLf & vbCrLf & "Font
Size is " & ctl.FontSize
End If
End If
Next ctl

frm.DatasheetFontName = "Tahoma" '"MS Sans Serif" '2003/09/23 dlg
frm.DatasheetFontHeight = 8
frm.DatasheetForeColor = 0
frm.RowHeight = -1

DoCmd.Close acForm, sFrmName, acSaveYes
Next i

End Sub
 
Back
Top