Results 1 to 3 of 3
  1. #1
    thebski is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    2

    Adding a value to a new field in Access


    Hey all,

    New to the forum here and pretty much new to Access in general. I'm importing a text file into Access. The file is just a string of numbers that I'm breaking apart into three fields. Once those three fields have been broken apart by the import tool I need to add a new field that just contains the year.

    For example, I import the 1990 data file that is .txt format and I break apart the three fields while it's imported. Once imported into three fields, I want to add a 4th field that says 1990 for every record. This has to be a pretty simple thing to do, but I can't figure out how to add a single number as a new field to every record in the database.

    Any suggestions? Thanks guys!

  2. #2
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Import one text file at a time. After the file is imported, execute an update query to set the field to the year.

    Code:
    UPDATE YourTable SET YourField = 1990 WHERE YourTable.YourField IS NULL
    You can set this up in the query design grid.

  3. #3
    thebski is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    2
    Quote Originally Posted by ssanfu View Post
    Import one text file at a time. After the file is imported, execute an update query to set the field to the year.

    Code:
    UPDATE YourTable SET YourField = 1990 WHERE YourTable.YourField IS NULL
    You can set this up in the query design grid.
    It worked wonderfully. Thank you so much sir!!

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

Similar Threads

  1. Replies: 2
    Last Post: 03-30-2012, 07:39 AM
  2. Replies: 10
    Last Post: 04-21-2010, 01:16 PM
  3. one to many relationship and field adding
    By cr1973 in forum Queries
    Replies: 0
    Last Post: 08-27-2009, 07:12 AM
  4. Adding a Field Name
    By jackthedog in forum Reports
    Replies: 1
    Last Post: 07-04-2009, 08:18 AM
  5. Adding pdf to a field
    By Hannu in forum Access
    Replies: 3
    Last Post: 05-27-2009, 07:08 AM

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