Getting literal string value

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
 
S

Stefan Hoffmann

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 <--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top