Results 1 to 4 of 4
  1. #1
    Abacus1234 is offline Competent Performer
    Windows Vista Access 2010 32bit
    Join Date
    Nov 2011
    Posts
    212

    Form in which each field is a default value.


    I have a form in which each field is a default value. When I open and close this form I expect it to create a row in the table but it doesn't. Can anyone explain why it does not populate the table. And is there a way to trigger it to populate the table.
    Thanks.

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    IIRC, you can use the Default Value property of a bound control to assign a value and doing it this way will create a new record. If it does not, use some code to save the record in the Form's UnloadEvent. If saving, alone, does not do the trick, use VBA to assign a value to one of the fields in the OnCurrent event.

  3. #3
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,835
    I think you cannot save a record where all the fields only contain default data. At least, in 2007 you cannot - not even in the table itself. You would have to update at least one field, even if it were only by modifying or adding/deleting one character.

  4. #4
    Abacus1234 is offline Competent Performer
    Windows Vista Access 2010 32bit
    Join Date
    Nov 2011
    Posts
    212
    Thanks for the responses. I was unable to make headway but eventually found a simpler way of simulating the default record I was trying to create.

    I used a macro condition to test if the max id field was equal to the current record I was working on, and if not updated a related record with a "dummy" record (which is what I was trying to do).

    If you follow many paths, you may find one that works.

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

Similar Threads

  1. Replies: 14
    Last Post: 06-18-2015, 04:09 PM
  2. Set table.field default from a form.
    By Thompyt in forum Access
    Replies: 6
    Last Post: 10-30-2014, 02:47 PM
  3. Form field default to 0 with no records
    By shank in forum Forms
    Replies: 17
    Last Post: 01-16-2014, 11:15 AM
  4. Replies: 6
    Last Post: 10-20-2012, 04:45 PM
  5. Set the default field for form veiw
    By amer in forum Database Design
    Replies: 2
    Last Post: 06-16-2010, 11:32 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