Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, August 25, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Text Cursor focus in Memo field
Marc Johnson
Posts: 252
 
Text Cursor focus in Memo fieldYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Apr 08 3:34 PM
I've added the following code to a memo field to add a time stamp to the memo when someone clicks the field:

Sub Memo1Click(Sender)
Memo1.Text = Memo1.Text & vbcrlf & Now() & ": "
End Sub

The problem is that the cursor goes to the top of the memo field instead of the end. How do I move the focus to the end of the text so new entries are entered correctly?

I'm sure the is simple and I'm missing something obvious.
[Reply][Quote]
Dan Carvin
Posts: 227
 
Re: Text Cursor focus in Memo fieldYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Apr 08 10:05 AM
I once worked with a memo field with a Timestamp button nearby that added the timestamp and set the focus. I seem to recall that then done that way (focus is set after the timestamp it added) the curser moved to the end of the text that was added.
[Reply][Quote]
Marc Johnson
Posts: 252
 
Re: Text Cursor focus in Memo fieldYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Apr 08 12:28 PM
Dan,

I ended up doing something similar. I created a second memo field for entering the note and then having a button to the right that would "Add Note" to the primary memo field with all the desired stamps and it worked great. An additional benefit is that you can make the primary memo field read-only, which in our case was a desired effect.
[Reply][Quote]
Dan Carvin
Posts: 227
 
Re: Text Cursor focus in Memo fieldYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Oct 08 6:24 PM
Well, I'm back around doing this again, but in 7.5 LAN rather than legacy, and I'm having the issues you reported:

The cursor goes to the beginning of the field rather than the end.

When I add the New test to the existing memo tect, I want a line feed, but any way I try to do that..

strNewNext & VBLF & strOldText
or
strNewText & Chr(10) & strOldText

.. just puts a | in between the new & old text.

Did you find a way around that?
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Text Cursor focus in Memo fieldYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Oct 08 6:31 PM
For the break to be valid, it needs to be both a CR and LF.

So either vbCrLf or Chr(13) & Chr(10)

-Ryan
[Reply][Quote]
Marc Johnson
Posts: 252
 
Re: Text Cursor focus in Memo fieldYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Oct 08 7:40 AM
As I mentioned I created two memo fields and a button on my form. The main memo field (Memo1) is read only. The other memo field (mmoEnterNotes) is where the user can enter the note. The button (btnAddNote) adds the text from mmoEnterNotes into the Memo1 field with some other info that I wanted to collect (like the users name).

Here is the code for the onClick event:
------------------------------------------------------
Sub btnAddNoteClick(Sender)
if mmoEnterNotes.Text = "" then
exit sub
else
GetUsername 'Collects the name of the current user and stores it in the strName var.
Memo1.Text = Memo1.Text & vbcrlf & Now() & " - " & strName & ": " & mmoEnterNotes.Text
mmoEnterNotes.Text = ""
end if
End Sub
------------------------------------------------------

Nice and simple. We didn't want the users to modify or mess with anyone elses notes, thus the read-only setting on Memo1.
[Reply][Quote]
Dan Carvin
Posts: 227
 
Re: Text Cursor focus in Memo fieldYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Oct 08 9:41 AM
Another advantage of the two-field approach is when two users are looking at the record at the same time. This client's complaint was when two users added to the memo field at the same time, the second user to save would overwrite the first user's changes. My approach is not to combine the text of the two memo controls, but instead the save button reads the old text from the database, adds it to the new test field and then writes it back to the DB (and refreshes the large memo control).
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 8/25/2025 12:56:16 PM