Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2005

    Unanswered: Txt box entry validation Access


    How do you get a msg box to pop up when a user does not enter txt into a txt box? What action do you need to put this code under? click, before change or what. What code would go there. Lets say the txt box name is txtfirstname.


  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    the forms before update event is probably your best bet. if you MUST go down this stylistic then I'd suggest you do all your validation in that event and then display a single message box reporting all errors. you will need to set the cancel parameter of the 'before update' to true to stop the data being written.

    An alternative approach is to use some form of colour coding to indicate required or invalid data in their respective controls. Then clear those flags / colours as each data element is accepted / validated - this can be accomoplished by placing a call to your validation routine in each controls on change. Its also worthwhile placing the same validation function call in the forms on current event - theoretically you shoulddn't need too as you don't let your users change data except in this form (do you?) - but its a prudent belt and braces solution just in case the data gets screwed.

    Last edited by healdem; 12-05-05 at 04:41.

Posting Permissions

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