Hi,
I have a procedure to help the user import a file from the c:\ directory into the database. The user basically has to select an option from a combobox and then click on a button to do the import. I anticipate that if they click the button and the expected file is not in the C:\ directory then an error occurs as the file does not exist in the required location and so cannot be imported.
Therefore I have written the following error handler:
This is however not working and the error still appears as normal.
Does anyone have any ideas of what I am doing wrong?
Thanks
I have a procedure to help the user import a file from the c:\ directory into the database. The user basically has to select an option from a combobox and then click on a button to do the import. I anticipate that if they click the button and the expected file is not in the C:\ directory then an error occurs as the file does not exist in the required location and so cannot be imported.
Therefore I have written the following error handler:
Code:
Private Sub btnImport_DblClick(Cancel As Integer)
[B]On Error GoTo Err_handle ' initialize error handling[/B]
If comboActions.ListIndex = 0 Then
DoCmd.RunMacro "USAGE - Import and update data"
ElseIf comboActions.ListIndex = 1 Then
DoCmd.RunMacro "SUBSCRIBERS - Import and update data"
ElseIf comboActions.ListIndex = 2 Then
DoCmd.RunMacro "SERVICE_CHARGE - Import and update data"
End If
[B]Exit_ErrProcedure:
Exit Sub
Err_handle:
MsgBox "Error! Ensure that the correct text file exists in the C:\ directory and try again!"
Resume Exit_ErrProcedure[/B]
End Sub
This is however not working and the error still appears as normal.
Does anyone have any ideas of what I am doing wrong?
Thanks