Results 1 to 4 of 4
  1. #1
    Alaska1 is offline Advanced Beginner
    Windows Vista Access 2003
    Join Date
    Oct 2010
    Posts
    55

    Required Fields in a Form

    I would like to have the required fields in the form not allow the person to move on to other fields if they did not add data in a field. I can set the required rule in the table, but it does not give you the warning until you save the record. I would like it to give a warning once they tab to the next field and have not added data in the required field.



    Any suggestion?

    Thank you!

  2. #2
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    Sure, this is common. The 'OnExit' event of each textbox is an ideal trigger to check for null or a value. And then either reset focus or a msgbox or both.

    Still the human can use the mouse to jump around, skipping a field, and thus never enter which of course means they don't trigger the OnExit. You can disable the mouse and force them to use the TAB. Or you can check all the fields in the form's property 'BeforeUpdate' - along with a msgbox, reset focus. Its all more work but more friendly than just a table system message....

    Merry Christmas!

  3. #3
    Alaska1 is offline Advanced Beginner
    Windows Vista Access 2003
    Join Date
    Oct 2010
    Posts
    55
    Quote Originally Posted by NTC View Post
    Sure, this is common. The 'OnExit' event of each textbox is an ideal trigger to check for null or a value. And then either reset focus or a msgbox or both.

    Still the human can use the mouse to jump around, skipping a field, and thus never enter which of course means they don't trigger the OnExit. You can disable the mouse and force them to use the TAB. Or you can check all the fields in the form's property 'BeforeUpdate' - along with a msgbox, reset focus. Its all more work but more friendly than just a table system message....

    Merry Christmas!
    If I put IsNotNull OnExit event how do I reset the focus or a msgbox?

    Merry Christmas to you!

    Thank you!

  4. #4
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    one can check a value passively and then do other events too...

    if IsNull(me.textbox) then
    msgbox "hey numbskull - gotta put in a value here!"
    me.textbox.setfocus
    end if

    the set focus only prevents the cursor from moving to the next box in the tab order.....

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

Similar Threads

  1. Required Field Help
    By brandonb in forum Access
    Replies: 4
    Last Post: 11-13-2009, 11:18 AM
  2. On Click - Ignore Required Fields
    By amy in forum Forms
    Replies: 1
    Last Post: 08-18-2009, 07:42 AM
  3. immediate help required
    By pdurgi in forum Access
    Replies: 1
    Last Post: 06-05-2009, 08:21 PM
  4. help required badly
    By pradeep_siemens in forum Programming
    Replies: 0
    Last Post: 05-28-2009, 04:41 AM
  5. Replies: 0
    Last Post: 02-15-2007, 03:07 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