Access: Set and get default values for fields
In Access, you can set a default value for table fields and get their data-typical specification. You can find step-by-step instructions here.
Microsoft Acces: Avoid incorrect data entries with default values for table fields
If standard values can be identified for certain table fields, you should already set them in the field properties. In the form view, the standard value already appears in the input field and only needs to be entered manually if the actual value differs.
- When you create a new table, open the design view by double-clicking on "Table design" on the "Create" tab. If you want to edit an existing table, also open it in the design view. The easiest way to switch between design view and data sheet view is to use the two icons in the right corner of the status bar at the bottom of the Access screen.
- You can now define or edit the field names and the field data type of your table. In the »Field data type« column you can call up a dropdown menu. Select the appropriate data type, for example "Number".
- Once you have defined the data type, you will see an overview of the field properties directly in the lower third of the design window. There you will also find the entry "Default value". Enter the default value for the field there, for example "0" (without quotation marks).
Microsoft Access: Define default values with the expression generator
For different data types, the standard values must be specified in a defined manner. So that you don't always have these expressions present, Access offers you the expression generator. Read here how you can access and use it.
- For example, you have selected "Date / Time" as the field data type and want to output the current date as the default value in your table. To do this, click with the mouse in the Default value field in the lower part of the design window. At the end of this field you will now see three small dots. Use this icon to call up the expression generator.
- You can use the expression generator to call up which expression values you can use as standard values. For example, if you click »Functions« -> »Integrated functions« -> »Date / time«, you will see all possible specifications in the »Expression values« container that you can use as the standard value for outputting a date.
- If you click on an expression value, the expression below the container is displayed in blue, which you must enter in the »Standard value« field. This describes what value is output by using the expression. For example, you must enter "= Dat ()" (without quotation marks) so that the current date is always output as the default value.
This practical tip is based on Access 2013, but can be used for all Access versions from 2007 onwards. It is often helpful to simplify the Access ribbon for your own purposes.