Results 1 to 4 of 4
  1. #1
    oatsybob is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2012
    Posts
    28

    How to make record in form not return #error when it can't find a default value

    I have a form to input information about correspondences between my organization and our partners. I've linked these data with two other tables: one that lists general information about the organizations and one that lists information about specific contacts within a particular organizations. For my input form about correspondence history, I've set the default values of the two fields that have relationships with the primary keys from these two other tables to pull values from two list boxes on another form. The problem is that in some situations, I want to input a correspondence history for an organization that I don't want to associate with a particular contact. In these cases, the record in my form returns #Error, because it's looking for a default value in a list box but not finding it. Is there a way to make the record return null instead of an error?

    Thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    You have the DefaultValue property referencing listbox on a form? That form must be open.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    oatsybob is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2012
    Posts
    28
    It is open. And it works fine when an item in the listbox is selected, but when there isn't it returns #Error

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    The textbox is bound to field? Is empty string allowed in table? (I don't allow empty strings in tables.)

    I just tried setting DefaultValue in table to a control and it doesn't work.

    Want to provide your db for analysis? Follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 7
    Last Post: 06-12-2012, 08:56 AM
  2. Replies: 2
    Last Post: 08-06-2011, 12:19 PM
  3. Find command default make it Any part of field
    By techexpressinc in forum Forms
    Replies: 0
    Last Post: 03-15-2011, 07:34 AM
  4. Replies: 9
    Last Post: 02-15-2011, 03:05 PM
  5. Replies: 3
    Last Post: 06-27-2009, 03:53 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