Query Update Not Working for Multiple Fields

Vasweetheart05

New Member
Joined
Nov 5, 2016
Messages
27
Hello,

I have the below Query Update (query name: Update Os) for multiple different fields from the same table:

Field: Account Management
Table: tbl_Current Week Closed
Update To: Null
Criteria: 0

The Query Update works if I'm only updating one field but once I add several more duplicate rows (with different field names), then the query doesn't work. For example, I have several more rows with the exact same data but differentiating fields like below:

Field: Customer
Table: tbl_Current Week Closed
Update To: Null
Criteria: 0

Field: Data
Table: tbl_Current Week Closed
Update To: Null
Criteria: 0

Any idea on how to make this work? Or why it doesn't work? I'm new with Access but I have a bunch of queries and tables that I need this action performed on. The action being to convert select cells from 0's to blanks.
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
When you add multiple fields with multiple criteria like that, it will only updates records where ALL of your Criteria is met (meaning it will only update records where all three of your fields are Null at the same time).
If you want to update each field individually if it is blank, you can use three different update queries (one for each field).
 
Upvote 0
Do you know if there is any "time saving" alternative? I have 5 queries with 14 fields requiring 0's to be replaced with blanks (Null)
 
Upvote 0
Well, you could create VBA that loops through the Recordset and checks each field, but if you are not an experienced VBA programmer, you probably wouldn't be able to create that code.

If this something that you are going to need to do time and time again, you can create all your individual Update Queries, then you can create a Macro to call and run each one.
Then, when you need to do it again in the future, you would just run this one macro.

Another option may be to create a Make Table Query, where you build a new table based on the old one, where you can set these zeroes fields to Nulls.

But let's take a step back.
Is this a numeric field?
Why do you need to remove the zeroes?
How is the data entered into Access?

If we have a better understanding of what you are trying to do and why, we may be able to suggest other alternatives.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top