Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18
  1. #16
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,820

    CANCEL = TRUE works in BeforeUpdate event.

    How does having code in general module prevent tampering?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  2. #17
    Join Date
    Apr 2017
    Posts
    1,673
    Instead of sub make it a function, which returns True when update must be canceled, and False when updating must be proceed. Then
    Code:
    Private Sub Form_BeforeUpdate(Cancel As Integer)
          Cancel = CheckForCancel())
     End Sub
    But having the check in separate function is useful only, when you can call it from several events (e.g. BeforeUpdate events of sevaral forms).

  3. #18
    Kundan is offline Competent Performer
    Windows XP Access 2013 32bit
    Join Date
    Mar 2018
    Posts
    155
    Quote Originally Posted by ArviLaanemets View Post
    Instead of sub make it a function, which returns True when update must be canceled, and False when updating must be proceed. Then
    Code:
    Private Sub Form_BeforeUpdate(Cancel As Integer)
          Cancel = CheckForCancel())
     End Sub
    But having the check in separate function is useful only, when you can call it from several events (e.g. BeforeUpdate events of sevaral forms).

    Thanks a lot!!! GOD BLESS YOU!!!!!!!!

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Validating Form Data using VBA
    By dweekley in forum Access
    Replies: 4
    Last Post: 05-16-2017, 09:32 AM
  2. Validating form data
    By dweekley in forum Access
    Replies: 5
    Last Post: 05-16-2017, 06:53 AM
  3. Validating the table
    By XPeriment in forum Access
    Replies: 5
    Last Post: 08-10-2016, 09:43 AM
  4. validating fields
    By bhatia.puja in forum Access
    Replies: 3
    Last Post: 07-28-2011, 05:24 AM
  5. Validating tables
    By JVagenheart in forum Database Design
    Replies: 1
    Last Post: 06-10-2006, 09:03 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums