May 21, 200322 yr Guys, I'm trying to put a field on my layout that is supposed to hold notes. I have a button on the layout that says: "Add comment". When a user hits that button, I want to insert text into the note field on top, with the current username, the date, and a ": ". Then the person should be able to type whatever he wants in there. My problem is that when I use the "insert" script text, the whole note field gets replaced. I guess my question is, how should I go about doing this? How do I avoid replacing text, and how do I make sure the text is inserted *before* all the other text that may already exist? Any ideas? Thanks!
May 21, 200322 yr Try using: Set Field["Notes", UserName & " " & Status(CurrentDate) & ": <CR>" & Notes] where <CR> is the carriage return character. This will add the username and date at the beginning of the notes field, followed by existing notes on the second line. However, I don't believe this will preserve text formatting in the existing notes. You may want to experiment with cut and paste in that case.
May 21, 200322 yr Hi, Bradm98's post will almost work but the date will not be displayed correctly as our notes field will be formatted as text and so will not recognise Status(CurrentDate) correctly without converting it to text. Try this: SetField["TextField", Status( CurrentUserName) & " " & DateToText( Status( CurrentDate) ) & " : " & "
Create an account or sign in to comment