Is there any way to count how many lines of text are stored in a particular table field? How about counting how many times was the "enter" key pressed?
"lines" are usually terminated with vbCrLf. You could try counting those characters or maybe just the LF or CR by itself would work. Post back if you need help with the function.
Public Function CountLines(InString As String) As Integer
Dim Counter As Integer
CountLines = 1
For Counter = 1 To Len(InString)
If Mid(InString, Counter, 1) = Chr(13) Then
CountLines = CountLines + 1
End If
Next
End Function
Called by: YourInteger = CountLines(Me.YourTextBox)
...using your control names of course.
Thank you Ruralguy. Sorry I did not respond earlier, but I went on vacation and just did not think of access at all...
Anyway, Let's say that I have a field in a form (Projects) that is called (pminput). How do I count the characters on that specific field using your example. Also, do I add the code on formload or odirty or afteredit?