3 Replies - 1095 Views - Last Post: 09 January 2014 - 03:43 AM Rate Topic: -----

#1 ChapMan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 02-June 12

On Error resume next Not working

Posted 08 January 2014 - 05:10 PM

Hi, Senior comrades,
I developed an application which was running smoothly. Just yesterday i run the application and the all the sub procedures that i used "on error resume next" gives the error that i wanted to ignore. Please what should do to turn on "on error resume next"? or is the any other error handler that works like on error resume next?
Is This A Good Question/Topic? 0
  • +

Replies To: On Error resume next Not working

#2 andrewsw  Icon User is offline

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3354
  • View blog
  • Posts: 11,352
  • Joined: 12-December 12

Re: On Error resume next Not working

Posted 08 January 2014 - 05:13 PM

Is this for VB6? VBA? It isn't Python..

And you'll need to post some code.

This post has been edited by andrewsw: 08 January 2014 - 05:14 PM

Was This Post Helpful? 0
  • +
  • -

#3 ChapMan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 02-June 12

Re: On Error resume next Not working

Posted 09 January 2014 - 02:05 AM

 Dim vdate1, vdate2 As Date
        On Error Resume Next
        'Declarations of variables
        Dim vdate1, vdate2 As Date
        vdate1 = Date
        vdate2 = Me.TxtDoB
        Dim vYears, vMonths, vDays As Integer
        'Calc date based on days, months, and years
        vMonths = DateDiff("M", vdate2, vdate1)
        vDays = DateDiff("D", DateAdd("M", vMonths, vdate2), vdate1)
        If vDays < 0 Then
        vMonths = vMonths
        vDays = DateDiff("D", DateAdd("M", vMonths, vdate2), vdate1)
        End If
        vYears = vMonths \ 12 'integer division
        vMonths = vMonths Mod 12 'only want leftover less than one yr
        'pass values to CmbAge
        If vYears > 0 Then
        Me.CmbAge.Text = vYears & "yrs"
        ElseIf vMonths < 1 Then
        Me.CmbAge.Text = vDays & "Days"
        ElseIf vMonths > 1 < 12 Then
        Me.CmbAge.Text = vMonths & "Mths"
        
        End If

This is just an example. but the fact is that all procedures that i used the on "error resume next" are giving me the error i want to ignore
Was This Post Helpful? 0
  • +
  • -

#4 andrewsw  Icon User is offline

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3354
  • View blog
  • Posts: 11,352
  • Joined: 12-December 12

Re: On Error resume next Not working

Posted 09 January 2014 - 03:43 AM

Moved to VB6 forum. Please post in the correct language-forum.

There is an Option (under Tools, Options, General in MS Office) "Break On All Errors".
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1