Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2015
    Posts
    2

    Unanswered: Validation data entry in Access 2013

    I have table in Access 2013.

    HOLE FROM TO
    A1 0 1
    A1 1 2
    A1 2 2 ----> not allowed "FROM" is equal to "TO"
    A1 2 3
    A1 2 3 ----> not allowed duplicate data
    A1 3 4
    A1 5 6 ----> not allowed interval gap between 4 and 5
    A1 6 8
    A1 8 12
    A1 12 15
    etc.

    What I need is data entry validation for fields "FROM" and "TO" to avoid that errors above.

    Thank you for your kind assistance.

    Regards,
    Supi
    Attached Thumbnails Attached Thumbnails assay.png  

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    problem 1:
    in your form put some code int he before update event that checks to ensure that values in the controls for from and to are not equal
    problem 2:
    declare an index comprised of Hole, From and To. make that index Unique, no duplicates. (actually if I was you Id' declare that as the primary key, assumign there is not a 'better' candidate out there)
    problem 3:
    how do you know
    interval gap between 4 and 5
    I can't see any way to determine that
    ...unless what you are tryign to say is that there should also be a row of
    Hole:A1, From:4 & To:5... in which case what you are missing is soemthign in sequence.
    in which case you should create those rows as required
    OR
    again in the forms before update event, check to see if proposed row will identify an interupted sequence, and decide what to do if it does dtect such an occurance
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Mar 2015
    Posts
    2

    Validation Access 2013

    Quote Originally Posted by healdem View Post
    problem 1:
    in your form put some code int he before update event that checks to ensure that values in the controls for from and to are not equal
    problem 2:
    declare an index comprised of Hole, From and To. make that index Unique, no duplicates. (actually if I was you Id' declare that as the primary key, assumign there is not a 'better' candidate out there)


    problem 3:
    how do you know I can't see any way to determine that
    ...unless what you are tryign to say is that there should also be a row of
    Hole:A1, From:4 & To:5... in which case what you are missing is soemthign in sequence.
    in which case you should create those rows as required
    OR
    again in the forms before update event, check to see if proposed row will identify an interupted sequence, and decide what to do if it does dtect such an occurance
    For problem 3, yes that is exactly what I mean. There should also be a row of Hole A1, from: 4 and to: 5.
    Thank you very much for your help...

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so presumably there is a 4th condition that from & to should not overlap (ie:
    a1 1 3
    a1 2,4... would be invalid

    the only way I can see of enforcing this is to do it via code int he forms before update
    if you are not familar with recordsets then use a series of domain fucntions such as dlookup and dmax to perform your validations. se tthe cancel falg to true if the data is invalid
    I'd rather be riding on the Tiger 800 or the Norton

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
  •