Results 1 to 4 of 4
  1. #1
    tagteam is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    494

    validate change to field based on another field

    I have a form i would like to validate input on. The field UpdatedResponsibilityCode can be updated but it can only have certain values based on the PaymentResponsibilityCode. Is there a way to force this validation?



    If UpdatedResponsibilityCode = 4 then PaymentResponsibilityID can not equal 1

    Thanks

  2. #2
    tagteam is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    494
    To add more information:
    This is a continuous form
    I would like a pop up that describes the error (not just conditional formatting)
    Would like it to not allow the change if it doesn't match the criteria

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Code:
    If Me.UpdatedResponsibilityCode = 4 then
    
          if me.PaymentResponsibilityID = 1 then
                 msgbox "PaymentResponsibilityID cannot equal 1." & vbcrlf & _
                             "The value has been reset to 0."
                 me.PaymentResponsibilityID = 0
    
                             if me.dirty = true then
                                   me.dirty = false    'Save current Record
                             end if
    
          end if
    end if

  4. #4
    tagteam is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    494
    Thanks, I will give that a try

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Change field color based on result
    By dniezby in forum Programming
    Replies: 1
    Last Post: 05-01-2013, 09:43 PM
  2. Change Value Based off Value in Field
    By jo15765 in forum Queries
    Replies: 3
    Last Post: 04-18-2013, 08:19 AM
  3. Replies: 1
    Last Post: 09-05-2012, 02:49 PM
  4. Replies: 1
    Last Post: 02-29-2012, 10:13 PM
  5. Validate Form Field based on Duplicate Data
    By bornfattom23 in forum Forms
    Replies: 3
    Last Post: 11-05-2010, 02:02 PM

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