Solved

MS Access 2010 - replacing a character with zer0

Posted on 2012-04-04
4
260 Views
Last Modified: 2012-04-04
I need to replace all fields in a table that contain a "-" with a "0",  in vba code.  I know it can be done in a query.
0
Comment
Question by:Startrac98
  • 2
4 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 37806881
Create your query, and then run it in VBA.  For what you are describing, it would look something like this:


dim strSQL as String
strSQL = "UPDATE YourTable SET YourField = Replace(YourField, '-','0')"
CurrentDB.Execute strSQL, dbfailonerror
0
 
LVL 10

Expert Comment

by:Anthony Berenguel
ID: 37806904
I like mbizup's solution.
0
 

Author Comment

by:Startrac98
ID: 37807112
Perfect, Thanks
0
 

Author Closing Comment

by:Startrac98
ID: 37807119
Yes, that works.  Thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question