Link to home
Start Free TrialLog in
Avatar of jforget1
jforget1

asked on

Carrying forward

I have a form which is completed and contains address info, after the user completes the form, they complete the same form again with new info. One thing that does not always change is the address. I want the address to carry forward to the new form. I have this code but am not having any luck.

      Dim uidoc As NotesUIDocument
      
      Dim doc, newdoc As NotesDocument
      
      Set uidoc=ws.CurrentDocument
      Set db = sess.CurrentDatabase
      Set doc= uidoc.Document
      
      
      Set newdoc = db.CreateDocument
      
      newdoc.Form = "ibpc_order_form2"
      newdoc.new_contact = doc.new_contact
      newdoc.new_ddress = doc.new_address
      newdoc.new_city = doc.new_city
      newdoc.new_state = doc.new_state
      newdoc.new_zip = doc.new_zip
      newdoc.new_phone = doc.new_phone
      newdoc.new_ccc = doc.new_ccc
      
      Call newdoc.save(True, False)
      
      Call ws.ComposeDocument ( "", "", "ibpc_order_form2" )
End Sub
Avatar of RanjeetRain
RanjeetRain

Set the "Formulas Inherit Values from selected document" chckbox in the property sheet.
you cannot do it by the way u are thinking, either you can use a dialog box where he fills up the form and closes it or just have the complete info in the same form , or the last case u can use environment variables or profile documents

Partha
When you compose a new document from a UI class, you have the option of inheriting values. Domino has designed the "Formulas Inherit Values from selected document" exactly for this purpose. You may find this property on the second tab of Form property sheet.
ASKER CERTIFIED SOLUTION
Avatar of HemanthaKumar
HemanthaKumar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jforget1

ASKER

Thanks for the help Hemanth, you always come through
Hemanth,
I didn't see that he is composing the same form which he is creating , Good Show !

Partha
Probably as Sjef mentioned you are still in 7th heaven ;-)

Come down to earth ..
Avatar of Sjef Bosman
LOL

One warning jforget1: if you think that
>     Dim doc, newdoc As NotesDocument
declares two NotesDocument variables, then you're wrong. The variable doc will be of type Variant. Why? It's Notes...

To properly declare two NotesDcouemtns on one line, you have to use
     Dim doc As NotesDocument, newdoc As NotesDocument