Results 1 to 3 of 3
  1. #1
    smith.jr is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jan 2014
    Posts
    9

    Default value in field based on value in other field

    I have a table with field_1 and field_2. If "NO" is entered in field_1, I would like the default value in field_2 to be "N/A". If field_1 is something other than NO, the default value in field_2 should be null. Both fields are required. Any suggestions?

    Thanks in advance for your help.

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    In situations like this I manage it at the form level using the after update event.

    if me.field1 = "No" then
    me.field2 = "N/A"
    end if

    Newer versions of Access probably have a way to manage this at the table level. If you are planning to use your app as a web app then you might consider trying to get it done at he table level.

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    Tell us more about your table in plain English. Seems there may be a design issue with your fields (to me anyway).

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

Similar Threads

  1. Replies: 10
    Last Post: 07-19-2013, 02:05 PM
  2. Replies: 2
    Last Post: 03-07-2013, 04:50 PM
  3. Replies: 4
    Last Post: 12-21-2011, 02:45 AM
  4. Replies: 3
    Last Post: 10-03-2011, 02:33 PM
  5. Replies: 1
    Last Post: 08-31-2011, 04:03 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