Solved

MS Access 2007 Replace Macro

Posted on 2008-10-30
7
232 Views
Last Modified: 2013-11-27
How i replace a specific value into a hole table using a Macro.    For Example if you have a field called Name and you need change every quoutes by a dash -.
0
Comment
Question by:JAYAYO
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 92

Expert Comment

by:Patrick Matthews
ID: 22844382
UPDATE SomeTable
SET SomeColumn = Replace(SomeColumn, """", "-")
0
 
LVL 2

Accepted Solution

by:
BobTheViolent earned 250 total points
ID: 22844417
I suggest using an SQL query.

In the macro you would do a "DoCmd.RunSQL" and then this.

UPDATE TABLENAME SET TABLENAME.FIELD= Replace([FIELD],Chr(34),"-");

this example replaces all occurences of a double quote with a dash as you asked.


Look up a chr code on this website to know which chr(#) to use
http://www.asciitable.com/
0
 

Author Comment

by:JAYAYO
ID: 22847252
Fastest response Excellent you save many work hours.
Thanks
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

Author Closing Comment

by:JAYAYO
ID: 31511815
Class A.  Thanks
0
 
LVL 92

Expert Comment

by:Patrick Matthews
ID: 22849101
JAYAYO,

Please explain your disposition to this question.  The syntax I provided was syntactically identical to the SQL
BobTheViolent posted, and I posted a little bit ahead of him.

A split would have suited me just fine, but I feel it is patently unfair to have received no credit on this one.

Patrick
0
 
LVL 92

Expert Comment

by:Patrick Matthews
ID: 22849102
BobTheViolent,

Please do not take my message above as a criticism.  I do not think you did anything wrong here :)

Regards,

Patrick
0
 
LVL 2

Expert Comment

by:BobTheViolent
ID: 22851327
matthewspatrick,
  I agree with you.  A split 50/50 would be fair since you did post before me with the same basic answer and we were both correct.
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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
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 …

751 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