Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
"<FirstName>";"<LastName>";"<SomeText>"
Option Compare Database
Option Explicit
Dim lngCursorPos As Long
Dim strText1 As String
Dim strInsert As String
Dim strText2 As String
Function CheckCursorPos()
lngCursorPos = Me.txtMessage.SelStart
'Debug.Print "lngCursorPos: " & lngCursorPos
End Function
Private Sub cmbInsert_AfterUpdate()
Dim lngNewCursorPos As Long
strInsert = Me.cmbInsert
lngNewCursorPos = Len(strText1 & " " & strInsert & " ")
Me.txtMessage = strText1 & " " & strInsert & " " & strText2
Me.txtMessage.SetFocus
Me.txtMessage.SelStart = lngNewCursorPos
Call CheckCursorPos
End Sub
Private Sub txtMessage_Click()
Call CheckCursorPos
End Sub
Private Sub txtMessage_Exit(Cancel As Integer)
Dim lngLenAllText As Long
Dim strCurrentText As String
strCurrentText = Me.txtMessage
lngLenAllText = Len(strCurrentText)
If lngCursorPos > lngLenAllText Then
'add space to end to make up difference
strCurrentText = strCurrentText & " "
lngLenAllText = Len(strCurrentText)
End If
strText1 = Left(strCurrentText, lngCursorPos)
strText2 = Right(strCurrentText, (lngLenAllText - lngCursorPos))
End Sub
Private Sub txtMessage_KeyUp(KeyCode As Integer, Shift As Integer)
Call CheckCursorPos
End Sub