In the code below, the .Replace function appears to run w/o error when I step through the code, but it doesn't replace the string. The original string is left intact. What's going wrong? Thanks.
VB Code:
Private Sub SetQuestionSql(ByVal cb As CheckBox) Select Case cb.Name Case "cbModule" If cb.Checked = True Then If mblnChanged Then mstrQuestionSQL &= " AND modcode = " Else mstrQuestionSQL &= " WHERE modcode = " mblnChanged = True End If Else If mstrQuestionSQL.IndexOf("AND modcode = ") <> -1 Then mstrQuestionSQL.Replace("AND modcode = ", "") Else mstrQuestionSQL.Replace("WHERE modcode = ", "") End If End If




Reply With Quote