The main problem is that the second argument of the Mid() function requires a LONG, not a string. Even though in the first example "sStartPosition" is a string, Access casts (changes) it from a "string" number to a Long, so it returns a value.
In the second example, you are trying to use a string value (for example 'the') in "sStartPosition" as the second argument of the MID() function.
While the function MID() has three arguments, the last argument, Length, is optional.
Try this:
Code:
Private Sub cmdInStr2_Click()
Dim sExtract As String
Dim sInput As String
Dim sStartPosition As Long
sInput = InputBox("What word or character would you like" & _
" to begin with?", "Where to begin?")
If sInput <> "" Then
If InStr(txtInput, sInput) = 0 Then
MsgBox "That value does not exist"
Else
sStartPosition = InStr(txtInput, sInput)
sExtract = Mid(txtInput, sStartPosition)
Me.txtOutput = sExtract
End If
End If
End Sub
Note that I removed ".Value" because value is the default property. It doesn't hurt to add it, but it is not required ( and no one uses it to save time and typing).