Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 269
  • Last Modified:

MS Access 2010 - replacing a character with zer0

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
Startrac98
Asked:
Startrac98
  • 2
1 Solution
 
mbizupCommented:
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
 
Anthony BerenguelCommented:
I like mbizup's solution.
0
 
Startrac98Author Commented:
Perfect, Thanks
0
 
Startrac98Author Commented:
Yes, that works.  Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now