Access.2007.VBA.Bibl..

(John Hannent) #1

On Error Resume Next


DoCmd.RunCommand acCmdSizeToFitForm

On Error GoTo ErrorHandler


intChoice = Nz(Me![BackupChoice], 2)

Select Case intChoice

Case 1
Me![cmdCustomBackupPath].Enabled = False

Case 2
Me![cmdCustomBackupPath].Enabled = False

Case 3
Me![cmdCustomBackupPath].Enabled = True

End Select

ErrorHandlerExit:
Exit Sub


ErrorHandler:
MsgBox “Error No: “ & err.Number _
& “; Description: “ & err.Description
Resume ErrorHandlerExit


End Sub


Private Sub fraBackupOptions_AfterUpdate()


On Error GoTo ErrorHandler


intChoice = Nz(Me![fraBackupOptions].Value, 2)
strBackupChoice = CStr(intChoice)
strBackupPath = Nz(Me![BackupPath])

Select Case intChoice

Case 1
Me![cmdCustomBackupPath].Enabled = False

Case 2
Me![cmdCustomBackupPath].Enabled = False

Case 3
Me![cmdCustomBackupPath].Enabled = True

End Select

Creating Access Add-ins 14

Free download pdf