Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    afrenz is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2021
    Location
    North Ga Mtns
    Posts
    9

    Question Clearing a column?

    First post. Just started using Access. Have simple one table DB so far. From time to time I need to erase the data in a column so I can reuse it again for new data entries. Is there a quick and easy way to clear the data in this column?

    Have seen searching the web but have not found an answer so far.

    TIA

  2. #2
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Use an update query to update all records in that field to Null - assuming your field constraints allow it. If not, a zls (zero length string) would be the only other way, again assuming it's allowed. You'd then update it as "".
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    afrenz is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2021
    Location
    North Ga Mtns
    Posts
    9
    Micron, Sorry but this is all new to me. Can you give a little more detail or provide an example or image? Or point me to some documentation on how to do this? I ordered
    Access for Dummies
    but it has not yet arrived.

  4. #4
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 10 Office 365
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,538

  5. #5
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Why do you need to clear existing data in order to make space for new entries?
    In a database you would normally just add new records ...
    OR if you need to alter existing records, you would use an update query.
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    afrenz,
    Please describe what you are trying to achieve in simple, plain English. Since you are admittedly "new to Access", tell us about the table and the process that requires "deleting data in a column". There may be options depending on the "business need".
    We (I) need more context in order to offer info that would be additional to the responses so far.

    Welcome to the forum.

  7. #7
    afrenz is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2021
    Location
    North Ga Mtns
    Posts
    9
    Quote Originally Posted by orange View Post
    afrenz,
    Please describe hat you are trying to achieve in simple, plain English. Since you are admittedly "new to Access", tell us about the table and the process that requires "deleting data in a column". There may be options depending on the "business need".
    We (I) need more context in order to offer info that would be additional to the responses so far.

    Welcome to the forum.
    One simple table imported from Excel. The table contains 1,054 entries. Ten columns. One column is used for notes during the quarter. At end of quarter, I need to remove all the notes so it is empty and available for the next quarter.

    I have not yet tried all the earlier suggestions but always open to a easier, user friendly solution.

    TIA

  8. #8
    Cottonshirt is offline Competent Performer
    Windows 8 Access 2007
    Join Date
    Feb 2018
    Posts
    116
    UPDATE QUERY

    an update query is used to change the values in existing records. likely scenarios would be to update the prices of items you buy or sell, or to update personnel details after name change, promotion or marriage, or to update the status of purchase orders, invoices or other records. an update query cannot create new records or delete records but it can be used to blank or null existing records or fields.

    an update query allows you to:

    * specify a value you want to replace
    * specify the value you want to replace it with
    * use criteria that do not depend on the value you want to replace
    * update many records in one go
    * update records in more than one table at a time

    an update query can not be used to:
    * create new records
    * delete existing records
    * update calculated fields
    * update fields from a totals query or a crosstab query
    * update autonumber fields
    * update fields in unique-values queries and unique-records queries
    * update fields in a union query
    * update fields that are primary keys

    Part a. update existing data in a single table using expressions (not from a table)
    1. in the query design window, open the table you want to update

    2. double-click the fields you want to update to get them in the field row in the grid

    3. in the criteria row, enter any criteria to select the records you want to update. you can set criteria on fields you do not want to update. a criteria might be Status = "Yes", or, date < 12-Feb-2012, or similar. you can have multiple criteria.

    4. click Run to verify the records you want to update.

    5. on the <design> tab, in the <query type> group, click Update. this will change your select query to an update query and open an update to row on the grid.

    6. in the update to row, enter the expression for each field you want to update.

    7. run the update query. an alert will display, click <Yes> and the query will run. the fields that appear in the dataset includes only those fields that were updated.



    good luck with your project,


    Cottonshirt

  9. #9
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    afrenz,

    Are you saying that Notes recorded throughout the quarter are simply deleted? There is no historical significance to the Notes?
    No comparison of 1 quarter's Notes to another?

    Perhaps you could describe "The table contains 1,054 entries. Ten columns." You my be making some decision(s) based on your spreadsheet knowledge without familiarity with database concepts.

  10. #10
    afrenz is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2021
    Location
    North Ga Mtns
    Posts
    9
    The answer I used was in a link (above) by provided by isladogs.

    Sorry, I picked the wrong one. It s/b 'alansidman' posted above!


    1. Select the field in table view


    2. Open Find and Replace


    3. Find What: *




    Look In: Current Field


    4. Replace all


    That's it.


    answered Apr 3 '19 at 18:25


    Tom

    Thanks for all the replies!
    Last edited by afrenz; 09-26-2021 at 12:40 PM. Reason: Thanks!

  11. #11
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Hmm. I can't see the link to the comments which I apparently made in April 2019. Please can you provide a link to the original post so I can see the context. Thanks
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  12. #12
    afrenz is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2021
    Location
    North Ga Mtns
    Posts
    9
    Quote Originally Posted by isladogs View Post
    Hmm. I can't see the link to the comments which I apparently made in April 2019. Please can you provide a link to the original post so I can see the context. Thanks
    Here it is:

    https://superuser.com/questions/4771...t-dele/1421011

    Sorry, I picked the wrong one. It s/b 'alansidman' posted above!

  13. #13
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Ah I see. Not me! I've never posted at that site!
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  14. #14
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    Blimey, some convoluted solutions there?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  15. #15
    afrenz is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2021
    Location
    North Ga Mtns
    Posts
    9
    Sorry, I picked the wrong one. It s/b 'alansidman' posted above!

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Clearing a Column of Data
    By dsc1014 in forum Macros
    Replies: 13
    Last Post: 06-27-2018, 12:06 PM
  2. Clearing and entire column
    By MaineLady in forum Access
    Replies: 2
    Last Post: 07-09-2016, 12:03 PM
  3. subform not clearing
    By slimjen in forum Forms
    Replies: 3
    Last Post: 06-06-2014, 03:21 PM
  4. cbo not clearing
    By buckwheat in forum Access
    Replies: 1
    Last Post: 06-26-2013, 03:51 PM
  5. Clearing a Form
    By dabatman in forum Forms
    Replies: 4
    Last Post: 01-20-2012, 11:51 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