I have a form that allows a user to right click on highlighted text and make changes to the data. The form has several fields with types including text, memo, and numeric. I don't want the user to be able to change numeric fields. I would like them to get prompted with a MsgBox if they attempt to right click on a numeric field. Here is the code that grabs the string and converts it. Does anyone know how to do this?
Set frmForm = Screen.ActiveForm
Set ctlActive = Screen.ActiveControl
With ctlActive
DoCmd.SetWarnings (False)
strRedacted = .SelText
intPosition = InStr(ctlActive.Value, strRedacted)
strLeft = Left(ctlActive.Value, intPosition - 1)
strRight = Right(ctlActive.Value, Len(ctlActive.Value) - ((intPosition - 1) + Len(strRedacted)))
strRedacted = String(.SelLength, 167)
Set frmForm = Screen.ActiveForm
Set ctlActive = Screen.ActiveControl
With ctlActive
DoCmd.SetWarnings (False)
strRedacted = .SelText
intPosition = InStr(ctlActive.Value, strRedacted)
strLeft = Left(ctlActive.Value, intPosition - 1)
strRight = Right(ctlActive.Value, Len(ctlActive.Value) - ((intPosition - 1) + Len(strRedacted)))
strRedacted = String(.SelLength, 167)