Getting literal string value

  • Thread starter Thread starter Dave Reardon
  • Start date Start date
D

Dave Reardon

Hi

I am attempting to do a bit of error trapping, and want to replace the words
'lower school' with 'Lower School' in a memo field as someone types. I have
set it on the on Change property of the field, and it works a treat, except
it doesn't discriminate between 'lower school' and 'Lower School' in
triggering the action. The syntax I am using is:

If strRight = "lower school" Then 'strRight is defined as
right(me.HoY_Comment.Text,12)

intResp = MsgBox("Possible capitalisation error. Do you mean Lower
School? ", vbOKCancel, "Capitalisation")
If intResp = vbOK Then
strHoYComm = Left(Me.HoY_Comment.Text, (LenFrm - 12))
Me.HoY_Comment.Text = strHoYComm & "Lower School"
End If

Any suggestions as to what I am doing wrong would be greatly appreciated.

Dave
 
hi Dave,

Hi
set it on the on Change property of the field, and it works a treat, except
it doesn't discriminate between 'lower school' and 'Lower School' in
triggering the action.
Any suggestions as to what I am doing wrong would be greatly appreciated.
Take a closer look at the StrComp() function using the vbBinaryCompare
option.


mfG
--> stefan <--
 
Back
Top