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

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

MS Access 2007 Replace Macro

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
JAYAYO
Asked:
JAYAYO
  • 3
  • 2
  • 2
1 Solution
 
Patrick MatthewsCommented:
UPDATE SomeTable
SET SomeColumn = Replace(SomeColumn, """", "-")
0
 
BobTheViolentCommented:
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
 
JAYAYOAuthor Commented:
Fastest response Excellent you save many work hours.
Thanks
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
JAYAYOAuthor Commented:
Class A.  Thanks
0
 
Patrick MatthewsCommented:
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
 
Patrick MatthewsCommented:
BobTheViolent,

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

Regards,

Patrick
0
 
BobTheViolentCommented:
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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

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