Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

Evaluate Value after each step in process

Discussion in 'Information Technology' started by BlakeD@ChoctawRecovery.com, Jul 28, 2006.

  1. BlakeD@ChoctawRecovery.com

    BlakeD@ChoctawRecovery.com
    Expand Collapse
    Guest

    I have a code block that is effectively running some data validation
    checks. I have them in the Form_BeforeUpdate event, and am running the
    evalation from an outside module. Code looks like this:

    Private Sub Form_BeforeUpdate(Cancel As Integer)
    On Error GoTo Error_Form_BeforeUpdate
    'Proceed with Data Checks until Exit or Cancel = True
    Cancel = modDataChecks.CheckData(Me.ADDRESS, 1, "Address")
    If True = Cancel Then Exit Sub
    End If
    Cancel = modDataChecks.CheckData(Me.FIRST_NAME, 1, "First
    Name")
    If True = Cancel Then Exit Sub
    End If
    Cancel = modDataChecks.CheckData(Me.LAST_NAME, 1, "Last Name")
    If True = Cancel Then Exit Sub
    End If

    Exit_Form_BeforeUpdate:
    Exit Sub

    Error_Form_BeforeUpdate:
    MsgBox Err.Description
    Resume Exit_Form_BeforeUpdate
    End Sub

    How can I make access evaluate the value of Cancel after each step and
    exit the sub if/when Cancel = True?
    I have tried Do While/Loop, While/Wend, but they all evaluate at the
    close of the loop / wend. Is there anything that evaluates after each
    step?
     
  2. Loading...

    Similar Threads Forum Date
    Sikh Values Blogs Oct 21, 2015
    Jainism Jainism and Sikhism: The Value of Being “Footnote” Traditions Interfaith Dialogues Jul 13, 2015
    World Why do we value gold? Breaking News Dec 9, 2013
    Canada Quebec's Charter of Values: If You Have A Personal Story, Please Share It Here! Breaking News Sep 19, 2013
    Canada Thousands March through Montreal to Protest Quebec Charter of Values (& Video) Breaking News Sep 16, 2013

  3. strive4peace

    strive4peace
    Expand Collapse
    Guest

    try this:

    '~~~~~~~~~~
    Dim mBoo as boolean, i as integer
    for i = 1 to 2 then
    select case i
    case 1
    mBoo = modDataChecks.CheckData( _
    Me.ADDRESS, 1, "Address")
    case 2
    mBoo = modDataChecks.CheckData( _
    Me.FIRST_NAME, 1, "First Name")
    end select
    if mBoo then
    CANCEL = true
    exit sub
    endif
    next i
    '~~~~~~~~~~~~~~`


    Warm Regards,
    Crystal
    Microsoft Access MVP 2006

    *
    Have an awesome day ;)

    remote programming and training
    strive4peace2006 at yahoo.com

    *

    BlakeD@ChoctawRecovery.com wrote:
    > I have a code block that is effectively running some data validation
    > checks. I have them in the Form_BeforeUpdate event, and am running the
    > evalation from an outside module. Code looks like this:
    >
    > Private Sub Form_BeforeUpdate(Cancel As Integer)
    > On Error GoTo Error_Form_BeforeUpdate
    > 'Proceed with Data Checks until Exit or Cancel = True
    > Cancel = modDataChecks.CheckData(Me.ADDRESS, 1, "Address")
    > If True = Cancel Then Exit Sub
    > End If
    > Cancel = modDataChecks.CheckData(Me.FIRST_NAME, 1, "First
    > Name")
    > If True = Cancel Then Exit Sub
    > End If
    > Cancel = modDataChecks.CheckData(Me.LAST_NAME, 1, "Last Name")
    > If True = Cancel Then Exit Sub
    > End If
    >
    > Exit_Form_BeforeUpdate:
    > Exit Sub
    >
    > Error_Form_BeforeUpdate:
    > MsgBox Err.Description
    > Resume Exit_Form_BeforeUpdate
    > End Sub
    >
    > How can I make access evaluate the value of Cancel after each step and
    > exit the sub if/when Cancel = True?
    > I have tried Do While/Loop, While/Wend, but they all evaluate at the
    > close of the loop / wend. Is there anything that evaluates after each
    > step?
    >
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page