MS Access Auto-populate (Default) Table

Posted on 2014-08-28
Last Modified: 2014-08-29

I have a table, ‘Table3’ that has 5 fields:  Condition1, Condition2, Condition3, Condition4 and Condition5.
Each one of these fields are formatted for ‘ShortText’ and can only be populated with 2 possible entries:
“” (Blank) or ‘Delete—‘

I have a separate Form with a button on it that is programed to determine if a particular filed should be “”(Blank) or contain the word ‘Delete—‘ and it will automatically fill the fields on Table3 accordingly.

Note:  This is based on If/Then/ElseIf statements related to entries on other Tables.  For example:

If Field3.Table5 = ‘1’ Then Field1.Table3 = “” (Blank) Else Field1.Table3 = “Delete—“
If Field3.Table5 = ‘2’ Then Field1.Table3 = “Delete--” Else Field1.Table3 = ““ (Blank)

Here’s my problem:  By default, all entries on Table3  are “”(Blank)—that is to say, if none of the conditions are met in one of my If/Then/ElseIF statement—Access will simply leave the field empty in Table3.

I want to reverse this.  What I want is all of the fields in Table3 to say “Delete—“ by default, and only turn to “”(Blank) if a particular condition is met.

Any idea how to do this?

By the way, I’m kind of new to Access so if you could really walk me through each step it would be most appreciated.

Question by:mdstalla
    LVL 84

    Accepted Solution

    You can set a Default value on your table, so that NEW records will have a specific value. To do that, open the table in design view and select the column you want to work with, then set the Default Value to whatever you want:

    Default Field Value

    Author Closing Comment

    Ha!  That was super easy!  I thought this would require 3 pages of code.

    Thanks Scott.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
    Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
    Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
    In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now