Private Sub cmdImport_Click()
On Error GoTo ErrHandler
DoCmd.RunCommand acCmdImport
ExitHandle:
Exit Sub
ErrHandler:
Select Case Err.Number
Case 2501
'Do nothing as cancel selected by user
Resume ExitHandle
Case Else
MsgBox Err.Number & vbCrLf & Err.Description
Resume ExitHandle
End Select
End Sub