Results 1 to 5 of 5
  1. #1
    brandonb is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2009
    Posts
    6

    Required Field Help

    I have the Validation rule set to <> NULL and some text in the validation text. I do not want the field skipped over at all so I included this in the BeforeUpdate event field:



    Private Sub Active_Name_BeforeUpdate(Cancel As Integer)
    If IsNull(Me.Active_Name) Or Me.Active_Name = "" Then
    MsgBox "You must enter the Active Name.", vbOKOnly
    Cancel = True
    Me.Active_Name.SetFocus
    End If
    End Sub


    Is there something I am forgetting? Anything else I should check? If I enter text and delete it everything works just fine. However, if I skip it entirely there is no error message.

  2. #2
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    if you skip it - - - you don't trigger the BeforeUpdate Event !!

    put the vb in the AfterUpdate event of a control you are certain will be completed after this control has been skipped....or put it in the BeforeUpdate of the form itself...

  3. #3
    brandonb is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2009
    Posts
    6
    I tried to put it in the afterupdate for the field I want and still had no luck. Does the code look OK? Is there a way to verify it is being checked? I have yet to see an error generated at all from the code.

  4. #4
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    maybe you don't have nulls or "" maybe you have some blank spaces in those fields...should work...you need to chop it up into pieces and test with known data....

  5. #5
    brandonb is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2009
    Posts
    6
    That's it! Thanks for the help. I just had to use better test scenarios.

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

Similar Threads

  1. immediate help required
    By pdurgi in forum Access
    Replies: 1
    Last Post: 06-05-2009, 08:21 PM
  2. help required badly
    By pradeep_siemens in forum Programming
    Replies: 0
    Last Post: 05-28-2009, 04:41 AM
  3. Object required
    By duckie10 in forum Access
    Replies: 1
    Last Post: 05-15-2009, 02:11 PM
  4. Replies: 0
    Last Post: 02-15-2007, 03:07 PM
  5. Set required user input
    By ZeusOsiris in forum Database Design
    Replies: 2
    Last Post: 12-04-2006, 07:13 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