Results 1 to 3 of 3

Thread: Validation Rule

  1. #1
    Join Date
    Mar 2009

    Unanswered: Validation Rule

    Hello Everyone,

    I am hoping someone can assist me here. I am creating a Form on a database that I have. There are a couple of Fields that I want to Validate based on the value in 1 or 2 other fields in the same table but I can not figure out the syntax of the expression on the Validation Rule.

    The First one I wish to validate is a Y/N field. the Y value should only be present if the Department field is equal to 7010 or 7190 otherwise it should be N. The Default value of the field is N.

    The Second one I want to Validate is the "Old Price" field. This field should have a value Greater then 0 IF, the Action Field is "Edit" and the "Price Change" Check box is True.

    Can someone help me with Syntax on this. I've tried using IIF but it doesn't seem to like that or I am not typing it correctly.

    Thank you!

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    IIRC validation rules in Access are usually applied to the column in th etbael, so you cna check to ensure the value of tghat column is sane, but I don't think you cna base the validation on the value of another column at table level.. you have to apply those rules in the form, usually in a before update event

    you have the option of setting the value automatically

    eg in the forms before update event
    if mycontrol.value = 7010 or 7090 then
    mybooleancontrol.value = true
    mybooleancontrol.value = false

    for the old price, Im guessing you want to force someone to do something
    if so thats in the forms on current event (which triggers when a fresh record is displayed
    if myoldprice.value = 0 then
    'whatever action field is = edit
    'whatever pricechange is = true
    'insert code here to handle where myoldprice <>0 if required
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Mar 2009
    Okay. Thank you very much. I have the Value's setting in a Query when I pull the data out to be loaded into another program so I will have to rely on that for the first part.

    The second part, I will have to watch carefully then. I did find soemthing in the Help that says you can not base a validation rule on another field.

    THanks anyway, was worth a shot.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts