Paste into multiple records in a table?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lucyh
    New Member
    • Sep 2010
    • 15

    Paste into multiple records in a table?

    I have a table which I have added another field to. This field has a default value of NA and although any new entries will automatically have the default value of NA, I need to enter NA in all the current records and there are 2047 of them. Other than copying and pasting "NA" one by one into 2047 records is there a quicker way to do this. I tried selecting multiple records in the table and pasting but it only pastes into the first record selected.

    Please tell me there is a quicker but simple way to do this.

    Many thanks
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32653

    #2
    A simple UPDATE query should do the trick for you :
    Code:
    UPDATE [YourTable]
    SET    [YourField] = 'NA'
    WHERE ([YourField] Is Null)
    I've assumed you only want to update those items where the field has no data in it currently. If you want to set all records regardless then simply remove the WHERE clause in line #3.

    Welcome to Bytes!

    Comment

    • lucyh
      New Member
      • Sep 2010
      • 15

      #3
      Many thanks. Just to check though..there are other fields that have records with a null value that I wouldnt want to have updated to NA - would following the update query only update records within a certain field or would it update all field records within the table that had a null value?

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32653

        #4
        It would only update records that had a Null in that particular field. The selected records would only have the specified field updated. Exactly what you need Lucy :)

        Comment

        • lucyh
          New Member
          • Sep 2010
          • 15

          #5
          Genius!!! Thanks NeoPa!! Always wondered what an update query was!! I'm self taught in access and slowly getting there!!

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32653

            #6
            You're very welcome of course :)

            Come back with more questions when you need. That should make the learning curve a little steeper.

            Comment

            Working...