Input Text Box Required

Posted on 2005-05-07
Last Modified: 2013-12-18

I am after some code which would allow a button on a form to bring up a dialog box, which in turn would allow text to be input, when this box is closed the text would then appear in a field on the form, this text would be appended to any other text that mihgt have already been typed into the box at an earlier date.

The text should be placed at the top of the other text in the field and it must have a date and user text stamp in the same field before the typed text.

Any help
Question by:DavidAbbott
    LVL 13

    Accepted Solution

    Easiest I think (depending on what you already have) is to make the dialogbox update a hidden, editable field.

    After opening the dialogbox you could transfer that hidden field's value to the visible one and empty the hidden one again.

    Something like:

    Field <visible> := <visible>;
       <hidden> != "";
       @SetField("<visible>", <hidden> + @Char(10) + <visible>);
    Field <hidden> := ""

    Author Comment

    Sorry, need it in script, forgot to mention that bit
    LVL 19

    Assisted Solution

    dim ws as new notesuiworkspace
    dim uidoc as notesuidocument
    dim curdoc as notesdocument

    set uidoc=ws.currentdocument
    set curdoc=uidoc.document


    tmpnewvalue=Inputbox("What is the new value?")

    curdoc.fieldnametobeAppendedInFirst=ss.commonusername+" updated on "+Today+": "+tmpnewvalue(0)+" "+tmpoldvalue
    LVL 13

    Expert Comment

    I created a small setup:
    -A dialogform "myDialog", containing a field "myNewValue" (ed, txt) in a layout-region.
    -A form (name not important) containing a hidden, editable text field "myFld", a visible computed for display text field "myFldDsp" (formula: myFld) and a button "Add to field", containing following script:

    Sub Click(Source As Button)
          Dim Session As New NotesSession
          Dim Db As NotesDatabase
          Dim Doc As NotesDocument
          Dim Ws As New NotesUIWorkspace
          Dim UIDoc As NotesUIDocument
          Dim oldTxt As String
          Dim newTxt As String
          Dim flgDlg As Integer
          Set Db = Session.CurrentDatabase
          Set Doc = Db.CreateDocument
          flgDlg = Ws.DialogBox("myDialog", True, True, False, False, False, False, "Enter your new value", Doc)
          If flgDlg Then
                Set UIDoc = Ws.CurrentDocument
                oldTxt = UIDoc.FieldGetText("myFld")
                newTxt = Doc.myNewValue(0)
                Call UIDoc.FieldSetText("myFld", newTxt & Chr$(10) & oldTxt)
                Call UIDoc.Refresh
          End If
    End Sub

    Author Comment

    OK, thanks so far madheeswar's works except for the ss.commonusername buggs out, all the rest works, am looking at Craz now.

    thanks so far
    LVL 19

    Expert Comment

    in the starting keep
    dim ss as new notessession

    Even CRak solution is also good.

    Author Comment

    madheeswar, both of you were very helpful, i tried to split points but the system gave them all to Crak, can we ammend at 50/50?

    If not can i can give you points anyway?
    LVL 19

    Expert Comment

    Please post a Question in Comunity Support with this link for Point split (50/50).
    its free.


    Author Comment

    OK done.

    Thanks to you both

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

      In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
    This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now