Mega Code Archive

 
Categories / VisualBasic Script / Forms
 

Open a form, format the fonts and close it

Sub PermanentFormFonts (strFont As String)     Dim objAO        As AccessObject       Dim objCP        As Object             Dim ctlControl    As Control           Set objCP = Application.CurrentProject     For Each objAO In objCP.AllForms         DoCmd.OpenForm objAO.Name, acDesign, , , , acHidden         For Each ctlControl In objAO.Controls             ctlControl.FontName = strFont         Next         DoCmd.Close acForm, objAO.Name     Next End Sub