J
Jael
Using MS Access 2003-Vista Ultimate-
I have a text box called txtJournal which has a memo field as it's control.
I use an option button to add a new entry. I use .SelLength & .SelStart to
position the cursor to the end and add a TDS whenever I add to the field.
This works fine until I get several lines. At this point, .SelLength shows
the correct value (~1123), but the .SetStart constantly places the cursor a
specific line rather than end. Is .SelLen limited in size?
Insight would be appreciated...
Jael
BTW is there any "gotchas" using memo that I should be careful of
encountering?
Code is:
Private Sub optJournalDate_Click()
If Me.optJournalDate Then
If Right(txtJournal, 1) = ";" Then 'Last line terminated?
Me.txtJournal = Me.txtJournal & vbCrLf & Format(Date,
"mm/dd/yy") & ": "
Else 'if not, terminate it properly
Me.txtJournal = Me.txtJournal & ";" & vbCrLf & Format(Date,
"mm/dd/yy") & ": "
End If
Me.txtJournal.SetFocus 'Make sure the focus is set
Me!txtJournal.SelStart = Me.txtJournal.SelLength
Me.optJournalDate = False 'reset option button
End If
End Sub
I have a text box called txtJournal which has a memo field as it's control.
I use an option button to add a new entry. I use .SelLength & .SelStart to
position the cursor to the end and add a TDS whenever I add to the field.
This works fine until I get several lines. At this point, .SelLength shows
the correct value (~1123), but the .SetStart constantly places the cursor a
specific line rather than end. Is .SelLen limited in size?
Insight would be appreciated...
Jael
BTW is there any "gotchas" using memo that I should be careful of
encountering?
Code is:
Private Sub optJournalDate_Click()
If Me.optJournalDate Then
If Right(txtJournal, 1) = ";" Then 'Last line terminated?
Me.txtJournal = Me.txtJournal & vbCrLf & Format(Date,
"mm/dd/yy") & ": "
Else 'if not, terminate it properly
Me.txtJournal = Me.txtJournal & ";" & vbCrLf & Format(Date,
"mm/dd/yy") & ": "
End If
Me.txtJournal.SetFocus 'Make sure the focus is set
Me!txtJournal.SelStart = Me.txtJournal.SelLength
Me.optJournalDate = False 'reset option button
End If
End Sub