Displaying the value in the feild

Hi Alll

I need to diaplay the the previous feild value in the current feild while exiting from the previous value.

Can any one help me where the code is going wrong inbelow LS

Sub Entering(Source As Field)

Dim workspace As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Dim servicenumber As Variant

Dim startsequencenum As Variant

Dim actualseqnum As Variant





Set uidoc = workspace.CurrentDocument



servicenumber=uidoc.FieldGetText("Service_Number")



startsequencenum=uidoc.FieldGetText("Start_Sequence_Number")

actualseqnum=uidoc.FieldGetText("Actual_Sequence_Number")

Messagebox uidoc.FieldGetText("Actual_Sequence_Number")

Print 	servicenumber + "-" +startsequencenum

Messagebox servicenumber + "-" +startsequencenum



actualseqnum=servicenumber + "-" +startsequencenum

Messagebox actualseqnum





Messagebox uidoc.FieldGetText("Actual_Sequence_Number")

End Sub

Regards Sruthi

Subject: Displaying the value in the feild

Hi,

if the fields names are x, x_1,x_1_1.

if we write following code in onBlur event of field x.

it will assign the value you entered into x_1, and the sum of x,x_1 will be set to x_1_1

Sub Onblur(Source As Field)

Dim workspace As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Set uidoc=workspace.CurrentDocument

Msgbox uidoc.FieldGetText("x")

Call uidoc.FieldSetText("x_1",uidoc.FieldGetText("x"))

Dim sum As String

If(uidoc.FieldGetText("x")<>"" And uidoc.FieldGetText("x_1")) Then

	sum=Cstr(Cdbl(uidoc.FieldGetText("x"))+Cdbl(uidoc.FieldGetText("x_1")))		

	Call uidoc.FieldSetText("x_1_1",sum)

End If

End Sub

Thanks

Sreedhar

Subject: RE: Displaying the value in the feild

Thanks Alll

I was able to do display the value by using uidoc.FieldSetText method

Thanks All Once again for the quick ewsponsw

Subject: Displaying the value in the feild

instead of variant you tak it as stringor you convert to string using cstr function

Subject: RE: Displaying the value in the feild

i changed variable to stringsbut still i am not able to get the value of the feild from the previous feild

How can will i get the sum of two number using ui workspace without refreshing the form and displaying in the third feild

Subject: RE: Displaying the value in the feild

I’m not sure I fully understand what you are trying to do, but from what you have written here -“How can will i get the sum of two number using ui workspace without refreshing the form and displaying in the third feild” - I am assuming:

You have 2 Editable Number fields and a third Number field which is either computed or editable, on your form.

On exiting a field, you want the 3rd field to compute to the sum of Fields 1 and 2

You want this to happen on field exit, not on Save or Post Save.

If this is the case do something like this in the exit event of your fields:

Dim s As New notessession

Dim ws As New notesuiworkspace

Dim uidoc As NotesUIDocument

Dim doc As NotesDocument

Dim sum As Variant

Set uidoc = ws.CurrentDocument

Set doc = uidoc.Document

sum = doc.field1(0) + doc.field2(0)

doc.field3 = sum

Please note: this code assumes your field names are ‘field1’, ‘field2’ and ‘field3’. Replace these with your field names. As previously mentioned, it also assumes that fields 1 and 2 are editable number fields, and that field 3 is also editable or is a computed number field. The code is not tested, so may need tweaking to work, but should at least serve as a guide.

Hope it helps

Subject: RE: Displaying the value in the feild

simple do one thing

just change those declarations to integer

100% it will work

paramesh-9731055656