Results 1 to 9 of 9
  1. #1
    Join Date
    Jun 2006
    Posts
    48

    Question Unanswered: Validating records before updating to master file

    Hi,

    I have a form with data for cheque no, amount and date. The form also has four command buttons namely:

    The first 3 are validation checks that are needed to be made before the data is transferred to the master file.

    1. View duplicate cheques
    2. View cheques with no cheque numbers
    3. View cheques already presented

    4. Update to master file

    Once there are duplicate cheques, the user has to make the necessary changes (e.g. remove duplicates). Once the duplicates are removed, and the user clicks view duplicate cheques...a message saying no records exist pops up.

    I want it to be mandatory for the user to go through the first 3 command buttons, make the necessary changes in each case (i.e. at the end of validation, on clicking those 3 buttons will result in the message stated above). It is only when this happens do I want the update to master file, transferring the data to the master file. If there are duplicate cheques and/or cheques with no numbers and/or already presented and the user clicks update to master file, an error message should pop up and the user is forced to ensure all checks are performed.

    Thanks.

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Is there a reason there have to be 4 buttons? Personally, I'd have one button and put all 4 processes behind it. It would do the duplicate check first, and exit if it found any and inform the user. Same for the other 2. Only when the first 3 parts were successful would it do the update.
    Paul

  3. #3
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    I agree. If the operation is required, don't make it so the user has to push a button first.

    Another way, similar to Pauls suggestion (which is the quicker to impliment) is to make the three operations occur each time a record is added. So, when I enter a duplicate check, for example, it appears in a list box or some other control.

    have fun,
    tc

  4. #4
    Join Date
    Jun 2006
    Posts
    48
    The users requested separate buttons as it is for their accounting functions, they wanted a separate button for each validation check. They wanted to view on screen and print the resulting output/report each time for each validation check and make some comparisons with hardcopy files, making one change at a time. It doesn't matter what order the validation checks are performed.

  5. #5
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    I would still put validations behind the update button. It wouldn't be hard to track whether the user had clicked the other buttons, but you still wouldn't know if they had actually corrected any problems.
    Paul

  6. #6
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    Do both. Give the users the ability to check each function as they go, but also include the functions as part of the final update so that when they press the final button, if anything is wrong (either they didn't run a check, or they didn't fix any of the problems they found) you catch it.

    tc

  7. #7
    Join Date
    Jun 2006
    Posts
    48
    Thanks TC. I agree with that but I'll just have to try to see if I can get the final update to capture all those validations checks before sending the data to the master file

  8. #8
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    Take the code behind each command button that performs a validation and make it a function (either in that form's module, or a public function in a seperate module).

    The function is a boolean (true/false) and the code performs the check, returning true if it passes, false if not.

    In the code for the command buttons, it is simply IF fnCheckOne THEN You're Good ELSE You're Not Good

    In the code for the update button, IF fnCheckOne AND fnCheckTwo AND fnCheckThree THEN Do the update ELSE Notify User

    Don't write the same code twice, somebody down the road will update one set and forget about or not know about the other.

    tc

  9. #9
    Join Date
    Jun 2006
    Posts
    48
    Thank you for your assistance, Tcace.

Posting Permissions

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