Replication formula change

I have tried some script that was posted here on the forum but for some reason I can not get it to work. What I want to do is change my local replica database formula to something besides the default @all. When I debug this code, it looks like it should work since you can see the code replacing the @all with my own formula and and then saves. But for some reason, it does not save. What is going on? Code below:

Dim repDetails As NotesReplication

Dim repEntry As NotesReplicationEntry

Dim nc As NotesNoteCollection

Dim destDb As New NotesDatabase(“”,“”)

Dim noteId As String

Dim nextNoteID As String

Dim i As Integer

Dim repDoc As NotesDocument

Dim formulaChg As String

'// Get the database some how …

Call destDb .Open( “”, “onlinenews.nsf” )

'// Get the replication settings

Set repDetails = destDb.ReplicationInfo

'// Get the replication details

Set nc = destDb.CreateNoteCollection(False)

nc.SelectReplicationFormulas = True

Call nc.BuildCollection

'// Step through the found design notes and get the associated replication entry

noteID = nc.GetFirstNoteId

For i = 1 To nc.Count

nextNoteID = nc.GetNextNoteId(noteID)

Set repDoc = destDb.GetDocumentByID(noteID)

'// Get the notes replication entry

Set repEntry = repDetails.GetEntry(repDoc.GetItemValue(“$ReplSrcServers”)(0), repDoc.GetItemValue(“$TITLE”)(0), False)

formulaChg=|SELECT (“Peter Thomas”=@UpperCase(@Name([CN];ReaderList)))" | DocumentType =“PROFILE”)|

repEntry.Formula = formulaChg

Call repEntry.Save

Call repDetails.Save

noteID = nextNoteID

Next

Subject: Replication formula change

HiJust 2 doubts about the code:-

|SELECT (“Peter Thomas”=@UpperCase(@Name([CN];ReaderList)))" | DocumentType =“PROFILE”)|

First it has 3 | in it. Did it really allow you to save this? (May be u can replace first and last | with {} )

secondly, @uppercase(@name …) will match with “PETER THOMAS” and not “Peter Thomas”

Subject: RE: Replication formula change

Thank you. That was it. I looked at everything else but the formula. Nothing like a second pair of eyes.