Results 1 to 8 of 8
  1. #1
    TenOc is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Feb 2015
    Posts
    94

    Required field in table -- Error before time to input data. -- Is Null not working.

    I am a newbie.



    I have the following fields on an Expense form -- see attached screen shot. I hope you can see the form. The "Who" field is a combo box that most of the time the user will select from a table of approved people. However, the user can also type in someone not on the approved list.


    Click image for larger version. 

Name:	Expense 2019-04-03_08h53_03.png 
Views:	14 
Size:	77.0 KB 
ID:	38002


    In the Expense table that stores the information from the form I have set all the fields to be "Required". The problem is that as soon as the user selects a who they receive an error that the date is required . This error is before the user has time to input the date.

    I have attempted to write code on the event of click the "add new expense" button to check to see if the fields are "null" without any luck. Any suggestion are welcome.

  2. #2
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    You are saying the form is based on 1 table where all the fields are required and immediately after selecting a combo list item the message pops up? Then you must have code on a combo event that is causing the record to be saved. If I don't have the details right, you need to clarify.
    If you are attempting to add a name when this happens, the method usually requires the value to be added and the record updated, which of course you can't because of the constraints you've applied. To use NotInList event, you'll have to move validation off of the table and on to the form.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Also check the tab order and make sure the Who field isn't last. It may be trying to move to the next record after you leave it.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    TenOc is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Feb 2015
    Posts
    94
    Quote Originally Posted by Micron View Post
    If you are attempting to add a name when this happens, the method usually requires the value to be added and the record updated, which of course you can't because of the constraints you've applied.
    There is no event procedure code when I move off (either tab or enter) who, but I am attempted to add a new record but I did not want the record to be added until I click the "add new record" or a "save and close" button that is not show in the screen shot.

    The tab order is correct.

  5. #5
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    but I am attempted to add a new record
    No idea what that means. What record - new name that isn't already there?
    You haven't clarified much and this has caught me on a bad day. I will probably drop out.

  6. #6
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Can you attach the db here?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    TenOc is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Feb 2015
    Posts
    94
    I think I found the problem. The tab order WAS wrong. I did not do a good test after I set the tab order correct. I went back and check a backup copy and found it was wrong when I had the problem. After I changed the tab order to be correct; I also did a lot of coding and messed everything up. Thanks All.

  8. #8
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    No problem.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 3
    Last Post: 05-10-2018, 07:48 AM
  2. Replies: 0
    Last Post: 07-30-2017, 08:27 AM
  3. Run-time Error '424': Object required
    By MCCDOM in forum Forms
    Replies: 1
    Last Post: 11-07-2014, 08:54 AM
  4. Replies: 3
    Last Post: 01-15-2012, 02:46 PM
  5. Run-time error '424': Object required
    By cowboy in forum Programming
    Replies: 18
    Last Post: 07-07-2010, 03:32 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