Results 1 to 6 of 6
  1. #1
    Aleem is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2013
    Posts
    3

    Question Default values in a form

    Hi,



    I have converted access DB to MS SQL database, while the code is still in Access.

    There are several form, when invoked have default values (kind of template) these work fine in Access but not in converted application these default values show up after the record is saved.

    Any ideas

    Thanks

    Aleem

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Check the DefaultValue property the form controls. If nothing there, then there is code that is populating the fields.

    Can MSSQL fields have a DefaultValue setting, like in Access tables?
    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
    lfpm062010 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Location
    US
    Posts
    415
    There are 3 places could have deafult value assigned.

    1) Access Table can have default value defined.
    2) Like June mentioned, the form "DefaultValue" property can defined default value.
    3) SQL Server Table can also have default value defined.

  4. #4
    Aleem is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2013
    Posts
    3
    Thank you for your replies. Sorry that I wasn't very clear.

    Access table has default values, that are transferred to SQL server. When run against access database the forms display default values when form is invoked.

    The issue is when the application is run against SQL Server, the default values do not get populated till the record is saved. So basically the user has to Save the form first to get the template. And if he/she wants to cancel it, that is not possible.

    Thanks

    Aleem

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Are you saying the form does not show the default values when bound to linked SQL table? Sorry, I don't know SQL database, maybe that is proper behavior.
    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.

  6. #6
    Aleem is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2013
    Posts
    3
    Yes, That's right.

    To me it seems that when record is created, Access populates the fields with default values. While SQL Server populates the null fields with default values upon saving.

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

Similar Threads

  1. Replies: 3
    Last Post: 06-27-2013, 06:16 PM
  2. default values in a form
    By kmims44 in forum Forms
    Replies: 9
    Last Post: 06-28-2012, 12:35 PM
  3. Default Values In Form
    By ASW in forum Programming
    Replies: 2
    Last Post: 01-18-2012, 08:55 AM
  4. Default Min & Max Date Values in Form
    By alsoto in forum Forms
    Replies: 3
    Last Post: 10-03-2011, 10:54 AM
  5. Default Values in a form
    By handjor in forum Forms
    Replies: 3
    Last Post: 08-03-2011, 09:11 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