Forum Discussion

KenInMA's avatar
KenInMA
Copper Contributor
Mar 10, 2024
Solved

Using a field value as default for next field

Very simple customer database with the usual fields, including First Name, Last Name, and File As.  I'd like the default for the File As field to be Last Name + First Name.  Thought it would be simp...
  • Karl_Donaubauer's avatar
    Karl_Donaubauer
    Mar 11, 2024

    Hi,

     

    1. In a table you cannot reference a field name in an expression for a default value. That's why you get the error message.

     

    2. A default value has to be there before or at the latest in the moment when a record is created. That's the point of a default value not only in Access.

     

    3. If I understand your intention correctly then you should use a form for data entry where you can use VBA code to populate the value (not default value) property of a field in the same record to set a standard value or filling aid for the users.

     

    To do this you can use sth like this e.g. in the AfterUpdate event of the Last Name and the First Name control:

     

    Me!FileAs = Me![Last Name] & Me![First Name]


    Servus
    Karl
    ****************

    Access DevCon - online conference April 18+19
    Access Forever

    Access News
    Access-Entwickler-Konferenz AEK

Resources