I designed a keyboard on a sub form to insert letters with diacritics in a text box at the cursor. The following code works OK if I don't use my computer keyboard (that's a big if). At that point, it will only add text after the last character in the text box. Here is the code on a button to insert the character á. N.B. These aren't my object names, I changed them to make the code more readable.
Suggestions will be gratefully received. Thank you.
SQL:
Private Sub cmdLcáInsert_Click()
Dim HoldValue As Integer
HoldValue = Forms!frmMain!fsbSub.Form!txtText.SelStart
Forms!frmMain!fsbSub.Form!txtText = _
Mid(Forms!frmMain!fsbSub.Form!txtText, 1, Forms!frmMain!fsbSub.Form!txtText.SelStart) & _
"á" & _
Mid(Forms!frmMain!fsbSub.Form!txtText, Forms!frmMain!fsbSub.Form!txtText.SelStart + 1)
Forms!frmMain!fsbSub.Form!txtText.SelStart = HoldValue + 1