Access vba
Having trouble getting the "On Error GoTo..." construct to take
effect. I've tried everything but it never seems to take effect and
I'm unable to trap the error. Below is the procedure I'm testing. When
running this procedure, it never enters the FormFonts_Err code. VBA error message appears with the error number I'm trying to trap.
Sub FormFonts(strFont As String)
On Error GoTo FormFonts_Err
Dim frmCurrent As Form
Dim ctlControl As Control
For Each frmCurrent In Forms
For Each ctlControl In frmCurrent.Controls
ctlControl.FontName = strFont
Next
Next
FormFonts_Exit:
Exit Sub
FormFonts_Err:
If Err.Number = 438 Then
Resume Next
Else
MsgBox Err.Description
Resume FormFonts_Exit
End If
End Sub
|