To actually change the values in the records in your table you can run an UPDATE Query against the table. You should always back your data up before running an UPDATE Query — there is no “undo” to return your data to its unchanged state (you could of course possibly run a second UPDATE Query to return it to its previous state — depending on what the first UPDATE actually did)!

Here is a handy UPDATE Query you could implement in your PAT database.

1. Scenario

The goal of this query is to “clean” your data of any extra spaces that may have crept in during the data capturing phase (users often add extra spaces at the end of words and phrases when entering data).

2. Trim function

The Trim() function removes leading and trailing spaces from a string. Interestingly, Excel’s TRIM() function removes extra spaces from within a string as well as leading and trailing spaces.

3. Query

Create a basic Query that includes the field(s) that you want to update, then complete the steps below with the help of this screenshot:

Screenshot of an UPDATE query in Design View
  1. Activate the Query Tools » Design ribbon,
  2. click on the Update button to convert the Select query to an Update query,
  3. an Update To row now appears in the design grid,
  4. click in the Update To row, and
  5. type the expression: Trim([fieldname])

4. Run!

Remember: an UPDATE query is an action query, if you double-click the query, it will run the query, so you must learn to always be careful when running it!

Running a Microsoft Access Update Query.Running a Microsoft Access Update Query.

By MisterFoxOnline

Mister Fox AKA @MisterFoxOnline is an ICT, IT and CAT Teacher who has just finished training as a Young Engineers instructor. He has a passion for technology and loves to find solutions to problems using the skills he has learned in the course of his IT career.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.