Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update some values of Document on click of button

Status
Not open for further replies.

pechettysuguna

Programmer
Oct 11, 2001
39
JP
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
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top