Results 1 to 4 of 4
  1. #1
    sk88 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    183

    saving default value to field problem

    I have a List box set to YES and default value set to YES.


    I would like to hide this field and when I click SAVE in my form, I would like to save it to my table.
    I did set the control source to the field that I want but somehow it is not working unless if I click on to YES then save.

    How do I set it in such a way which will save even without me clicking on to the LIST BOX?

    in other words.. basically I want the default value to be saved when I click SAVE command button.

    Thanks

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,622
    One way is to set the field's default property in the table.
    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
    sk88 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    183
    That works but only for one form.

    My table is actually linked to 2 different forms. If I default the field's value in the table, it forces the value even when I don't need it.

    Is there a way that when I Hit save in the form, then only the value will be saved?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,622
    Assuming the field is part of the form's RecordSource, in some event populate the field with: Me!fieldname = vbTrue

    Must use -1 or 0 as value in Default property for Yes/No field.
    Last edited by June7; 01-10-2012 at 02:56 AM.
    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. problem while saving database design
    By Ramya in forum Database Design
    Replies: 1
    Last Post: 08-02-2011, 07:39 AM
  2. Problem Saving Access 2007 to 2003 database
    By spkoest in forum Access
    Replies: 4
    Last Post: 05-03-2011, 04:44 PM
  3. Auto-fill field not saving to table
    By aaid in forum Forms
    Replies: 1
    Last Post: 12-18-2009, 05:34 PM
  4. Auto Populated Field not Saving to Table
    By EstesExpress in forum Forms
    Replies: 4
    Last Post: 10-09-2009, 03:33 AM
  5. Default Value in table = Field plus 3 days
    By AmyLynnHill in forum Access
    Replies: 1
    Last Post: 08-03-2008, 01:58 AM

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