expression a valid String.
find the string you are searching for.
replace the replacement string.
start where to start the search.
count the number of replacements you wish.
compare the type of comparision.
In this example we will work with the words "Access Learning".
The result is "Accpps Learning".
The Settings are:
Settings
Constant
Value
Description
vbUseCompareOption
-1
Performs a comparison using the setting of the Option Compare statement.
vbBinaryCompare
0
Performs a binary comparison.
vbTextCompare
1
Performs a textual comparison.
vbDatabaseCompare
2
Performs a comparison based on information in your database. (Microsoft Office Access 2007 only.)
The Return Values:
Return Values
If
Replace Returns
expression is zero-length
Zero Length string ("")
expression is Null
An Error
find is zero-length
Copy of expression
replace is zero-length
Copy of expression with all occurances of find removed.
start > Len(expresion)
Zero Length string ("")
count is 0
Copy of expression
FORM
In a Form you could set the Default Value of a Textbox to
=REPLACE("Access Learning", "es", "pp")
VBA
In a Form add a TEXTBOX control and rename it "txtReplace", then you could add the following in the Load Event.
Private Sub Form_Load()
txtReplace = REPLACE("Access Learning", "es", "pp")
End Sub