Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I have learned more through this forum than I did on a two day course. Thanks to everyone for their help and other postings that I have found useful..."

Geography

Where in the world do Tek-Tips members come from?

Update some values of Document on click of button

pechettysuguna (Programmer)
22 Nov 06 2:54
Hi,
Wanted to update some document, but not able to set the value to the textfield.
Request help me to add the statement in below code at
'***Statement to update the values in the document"

'------------------------
Dim Session As New NotesSession
    Dim db As NotesDatabase
    Dim Doc As NotesDocument
    Dim j,mynum As Long
    
    Dim dc As NotesDocumentCollection
    Dim notesformula As String
    Dim datetime As New NotesDateTime("12/01/80")
    
    Set db = Session.currentdatabase
    NotesFormula = "Form =  ""fe00emp"""
    Set dc = db.Search(notesformula, datetime, 0)
    
    If dc.count = 0 Then
        Messagebox "No values"
        Exit Sub
    End If
    Set doc = dc.getnthdocument(dc.count)
    Print "Total values found " & Str(dc.count)
    mynum =0
    
    For j = 1 To Dc.count
        Set doc = dc.getnthdocument(j)         
        k = j + 1        
        If  (doc.e00_ti(0) ="" )Then
            If  (doc.e00_sex(0) ="M" )Then
                mynum=mynum+1    
'***Statement to update the values in the document"
            End If        
        End If
    Next
'------------------------

thanks
suguna
pmonett (Programmer)
22 Nov 06 9:19
You have a typical beginners confusion with how you set data and how you retrieve it.

To retrieve info from a field in a Notes document, you need to specify the position, even if the field is not an array or a multi-value field. Therefor, you write :

CODE

total = doc.total(0)
However, to set a value, you only need to give its name :

CODE

doc.total = totvalue

Of course, if you are dealing with a multi-value field, I find it much safer to declare a NotesItem object and use the AppendToTextList method.

Pascal.


I've got nothing to hide, and I'd very much like to keep that away from prying eyes.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close