Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 547
  • Last Modified:

MS Access Auto-populate (Default) Table


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.

1 Solution
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
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
mdstallaAuthor Commented:
Ha!  That was super easy!  I thought this would require 3 pages of code.

Thanks Scott.

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now