473,563 Members | 2,856 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

On Error Resume Next - not working

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("AppNam eDac", "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
Nov 13 '05 #1
3 5453
On 12 Dec 2004 07:57:08 -0800, to*******@tisca li.co.uk (tom blower)
wrote:
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("AppNam eDac", "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


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

HTH
Matthias Kläy
--
www.kcc.ch
Nov 13 '05 #2
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" <to*******@tisc ali.co.uk> wrote in message
news:91******** *************** ***@posting.goo gle.com...
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("AppNam eDac", "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

Nov 13 '05 #3
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.Set Option "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

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
6477
by: aaron | last post by:
On Winxp Pro I try to trap an error: On error resume next If (Err.Number <> 0) Then End sub End If but no matter what the case Err.Number = 0. When I was using visual basic 6.0 on a win2k pro computer, errors were returned with values other than 0.
3
3268
by: Michael | last post by:
Hello again everyone, Hope you can help. I have a form with a lot of code going on in the background but I can't find the route cause of the following error message. Update or Cancel Update Without Add New or Edit. I understand that when trying to update records you have to work
13
6581
by: deko | last post by:
I use this convention frequently: Exit_Here: Exit Sub HandleErr: Select Case Err.Number Case 3163 Resume Next Case 3376 Resume Next
6
8444
by: Squirrel | last post by:
I have a command button on a subform to delete a record. The only statement in the subroutine is: DoCmd.RunCommand acCmdDeleteRecord The subform's recordsource is "select * from tblVisit order by VisitDt" I'm getting this error message: Errno is 2465. Err.description is "Can't find field '|' referred to in your expression"
10
2273
by: Anthony England | last post by:
(sorry for the likely repost, but it is still not showing on my news server and after that much typing, I don't want to lose it) I am considering general error handling routines and have written a sample function to look up an ID in a table. The function returns True if it can find the ID and create a recordset based on that ID, otherwise...
0
7704
by: gm | last post by:
Immediately after generating the Access application from the Source Safe project I get: "-2147467259 Could not use ''; file already in use." If Access database closed and then reopened I get: "-2147467259 The database has been place in a state by user 'Admin' on machine ..... that prevents it from being opened or locked."
3
27403
by: bob.needler | last post by:
I know On Error Resume Next is generally considered lazy. But can someone tell me why the resume next in Exit_Handler does not seem to work? It generates the typical unhandled runtime error message from Access. If I comment out the 1st On Error Resume Next and the x = 1 / 0 on the next line there is no difference, i.e. ther same unhandled...
4
3762
by: Neo | last post by:
I found on error resume next doesn't work in for each... e.g. on error resume next for each x in y 'do stuff next if you have an error in for each loop, it falls in infinite loop... it doesn't move to next element... this sad thing but, it's indication that we must move to try catch instead of on error.
11
47967
by: Maxwell2006 | last post by:
Hi, I know that this is not a good practice, but I wonder do we have "on error resume next" in C#? Thanks,
4
11326
by: Abdhul Saleem | last post by:
Hi, I am recieving error ActiveX component can't create object in the following line in the asp page. set ExcelApp = CreateObject("Excel.Application") Previously this code was working fine. Thanks in advance.
0
7665
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7888
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7642
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2082
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.