How do I use the acCmdReplace command in code

L

Lambo

I've called up the command acCmdReplace using the DoCmd.RunCommand line in
access, but how do I set the parameters to find the specific string and
replace it across the whole table without the FindandReplace command box
appearing on the screen.
 
F

fredg

I've called up the command acCmdReplace using the DoCmd.RunCommand line in
access, but how do I set the parameters to find the specific string and
replace it across the whole table without the FindandReplace command box
appearing on the screen.

The most complete list of RunCommands available, as far as I know, is
at:
http://home.clara.net/tkwickenden/

acCMDReplace opens the dialog box, it doesn't find and replace by
itself.

If you wish to find and replace directly, there are other methods,
such as zn Update query, or opening a recordset and looping, etc.
Perhaps if you tell us more someone can suggest an alternative.
 
L

Lambo

Thanks Fredg, I've got a table of 70,000 records which I need to export as a
txt file using a comma as a seperator with no field delimeters. Unfortunately
the table has a number of records with a comma in them which effects the next
program which needs to recieve the txt file. The other problem is that the
table comprises of over 50 fields so the easiest way is to automate the find
and replace option in code. I'm sure this was possible in Access2.0 using a
macro.

The process needs to be automated i.e no user intervention.
 
D

Douglas J. Steele

No. The easiest way is to create a query that uses the Replace function on
each of the 50 fields, and then export the query, not the table.
 
Top