Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

MS Access 2010 - replacing a character with zer0

Posted on 2012-04-04
4
Medium Priority
?
267 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 2000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

772 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