Results 1 to 6 of 6
  1. #1
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839

    Set a default on the fly

    How would I set the default value on a table from a form with a combo box? I have pre-defined values I want in the list


    Form!Settings.Type Row source: Text values

    I would like to change the default value in the table Table_Name.Type on the fly by using the form and not having to have to go into the table and edit the controls manually.



    Thanks

  2. #2
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,428
    in the relevant form control properties, just set the default value to what you want. Note this will not be assigned to a new record until the record is saved - and will not be applied to blank fields in existing records

  3. #3
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839
    Ajax,
    Not tracking. I have:

    Form = Settings
    Form Record source = SELECT DISTINCT [Changes].Type;

    ComboBox
    Control source = Type
    Row Source = "Choice 1";"Choice 2";"Choice 3"
    Row Source type = Value List
    Bound Column = 1

    I run the form and I can drop to see the choices, but cannot select.

    This would write to the table?

  4. #4
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,428
    1. type is a reserved word so change it to something else (e.g. ChangeType) and see if that solves the problem
    2. your form recordsource is incomplete - needs a 'From sometable'

  5. #5
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839
    Changed it to Types

    SELECT DISTINCT [Changes].[Types] FROM [Changes];

    Same issue

    Update
    I restarted and made a new form - I can select them and they stay and I can select the icon to set Default. But it does not write to the field in the Change Table when I open another form to input data. Am I supposed to link that field from the Settings form for any other form used?

    This would also be defeated by importing data from another source?

  6. #6
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,428
    and you corrected the combo as well?

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

Similar Threads

  1. Default Value Problem
    By TheHarleygirl2005 in forum Forms
    Replies: 2
    Last Post: 09-03-2013, 11:55 AM
  2. Default Value from Another Field
    By ineedaccesshelp in forum Access
    Replies: 5
    Last Post: 11-28-2012, 12:37 PM
  3. Default Value
    By Njliven in forum Access
    Replies: 1
    Last Post: 10-10-2012, 12:48 PM
  4. Set default value
    By accessnewb in forum Programming
    Replies: 3
    Last Post: 08-17-2011, 06:24 PM
  5. Default value
    By Hatye in forum Access
    Replies: 1
    Last Post: 06-19-2011, 05:16 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