Hi Guy's hope you are all safe and well
I am trying work out how to remove a string and 2 new lines, so if when I add a new sentence using the Replace function, what is the method of using the replace function to remove the added sentence (paragraph) ?
The following code works great as it picks out the replaces or adds extra tot he reply
Code:
Dim myRow As Integer, NewStr As String, FindStr As String, OrgStr As String, myStr As String, NewReply As String, NewText As String, OldText As String, iOpt As Integer
myRow = Me.cboAddLine.Column(0)
NewText = Me.cboAddLine.Column(2)
OldText = Me.cboAddLine.Column(3)
OrgStr = Forms!frmMainMenu!txtReply
Select Case myRow
Case 1
myStr = Replace(OrgStr, OldText, NewText & vbNewLine & vbNewLine & OldText)
Me.txtReply = myStr
Case 2
myStr = Replace(OrgStr, OldText, OldText & vbNewLine & vbNewLine & NewText)
Me.txtReply = myStr
Case 3
myStr = Replace(OrgStr, OldText, OldText & vbNewLine & vbNewLine & NewText)
Me.txtReply = myStr
Case 4
myStr = Replace(OrgStr, OldText, OldText & vbNewLine & vbNewLine & NewText)
Me.txtReply = myStr
End Select
The above code is great and works well, just want to have basically an undo button, so now effectively want to undo this back to normal OrgStr (Original text)
This code I have took some ideas and messed around but I don't think I understand how to use replace to reverse the NewText and remove the x 2 vbNewlines
A lot of this is bypassed as i am getting lost how to do it 
Code:
Dim myStr As String, OrgStr As String, NewStr As String
myStr = Me.cboAddLine.Column(2)
OrgStr = Me.txtReply
' If Len(myStr) <> 0 Then
' If Right$(myStr, 2) = vbCrLf Or Right$(myStr, 2) = vbNewLine Then
' myStr = Left$(myStr, Len(myStr) - 2)
' End If
'End If
myStr = Replace(OrgStr, myStr, OrgStr)
Me.txtReply = myStr
' txt = txt.Replace(vbCr, "").Replace(vbLf, "")
'strText = Replace(Replace(strText, Chr(10), ""), Chr(13), "")
'If Right(Str, 1) = vbLf Then Str = Left(Str, Len(Str) - 1)
' myStr = Replace(OrgStr, OldText, NewText & vbNewLine & vbNewLine & OldText)
'Me.txtReply = myStr
Please forgive me if i have explained this wrong, we have lost a family member recently so trying get my mind back on track!!!!!!
Kindest