Connecting Tech Pros Worldwide Forums | Help | Site Map

On Error Resume Next - not working

tom blower
Guest
 
Posts: n/a
#1: Nov 13 '05
Access 2k (10.6501.6714) SP3

For YEARS the code line "On Error Resume Next" has worked without any
problems. It is an essential tool. A couple of days ago, I put in
another hard drive, mentioned because the problems have arisen since
then, and transferred a lot of files, mainly MDB files, to the new
drive. This line of code now fails to work in all the databases I have
tried. I get error messages where none appeared before. I tried to
following code as a test.

Dim test As String
On Error Resume Next
test = DLookup("AppNameDac", "tblFirm")

The lookup field is a null. Without the offending line I get an error
and exactly the same result when the line is inserted. I have
decompiled. I have put the mdb file back where it was originally.

Has anyone any idea why this should suddenly plague me? What have I
done?

Thanks

Matthias Klaey
Guest
 
Posts: n/a
#2: Nov 13 '05

re: On Error Resume Next - not working


On 12 Dec 2004 07:57:08 -0800, tomblower@tiscali.co.uk (tom blower)
wrote:
[color=blue]
>Access 2k (10.6501.6714) SP3
>
>For YEARS the code line "On Error Resume Next" has worked without any
>problems. It is an essential tool. A couple of days ago, I put in
>another hard drive, mentioned because the problems have arisen since
>then, and transferred a lot of files, mainly MDB files, to the new
>drive. This line of code now fails to work in all the databases I have
>tried. I get error messages where none appeared before. I tried to
>following code as a test.
>
>Dim test As String
>On Error Resume Next
>test = DLookup("AppNameDac", "tblFirm")
>
>The lookup field is a null. Without the offending line I get an error
>and exactly the same result when the line is inserted. I have
>decompiled. I have put the mdb file back where it was originally.
>
>Has anyone any idea why this should suddenly plague me? What have I
>done?
>
>Thanks[/color]

What error message do you get?
Did you compile the mdb?
Did you check the references?

HTH
Matthias Kläy
--
www.kcc.ch
Ken Snell
Guest
 
Posts: n/a
#3: Nov 13 '05

re: On Error Resume Next - not working


Check in VBE (Tools | Options | General tab) that your db file is not set
to break on all errors. Should be set to break on unhandled errors.

--

Ken Snell
<MS ACCESS MVP>

"tom blower" <tomblower@tiscali.co.uk> wrote in message
news:913602d4.0412120757.5e908ba5@posting.google.c om...[color=blue]
> Access 2k (10.6501.6714) SP3
>
> For YEARS the code line "On Error Resume Next" has worked without any
> problems. It is an essential tool. A couple of days ago, I put in
> another hard drive, mentioned because the problems have arisen since
> then, and transferred a lot of files, mainly MDB files, to the new
> drive. This line of code now fails to work in all the databases I have
> tried. I get error messages where none appeared before. I tried to
> following code as a test.
>
> Dim test As String
> On Error Resume Next
> test = DLookup("AppNameDac", "tblFirm")
>
> The lookup field is a null. Without the offending line I get an error
> and exactly the same result when the line is inserted. I have
> decompiled. I have put the mdb file back where it was originally.
>
> Has anyone any idea why this should suddenly plague me? What have I
> done?
>
> Thanks[/color]


tomblower@tiscali.co.uk
Guest
 
Posts: n/a
#4: Nov 13 '05

re: On Error Resume Next - not working


Thanks for the replies, which have helped to concentrate the mind!

The Options are set OK, but there is always the possibility that
someone might change them manually.

What was wrong was that I had inadvertently set Error Trapping to 0. I
had been playing with this the other day.

Application.SetOption "Error Trapping", 2
on loading the startup form solves the issue. This should be a
standard line of code in all applications so that the issue is
controlled once the application is "out there".

Thanks


Reply
Details: Show quoted text | View source | Unwrap Lines | Forward

Closed Thread