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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Button in current for that opens another form...

Status
Not open for further replies.

BrianBailey

Technical User
Mar 21, 2003
10
US
Basically, I have two simple forms: Training and Attendee. Basically, I want to add a button to the Training form that will open a blank editable Attendee form. I have meeting fields in the Attendee form set to inherit Training info, but the name and address and such should be blank.

Anyone that can help me with this?
 
Here is some code that I have on a button in a form that opens a second form to allow entry of Employment Details. It opens the second form in the same edit state as the original form.

Code:
Sub Click(Source As Button)
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set uidoc = workspace.currentdocument
If uidoc.IsNewDoc Or uidoc.EditMode Then
  Call workspace.DialogBox("Employment", True, True, True, False, False, False, "Employment Details")
Else
  Call workspace.DialogBox("Employment", True, True, True, False, False, True, "Employment Details")
End If
End Sub

HTH





Leslie
landrews@metrocourt.state.nm.us

There are 10 types of people in the world -
those who understand binary
and
those who don't!
 
I used that script, but when I hit the OK button it does not save the second form.

Any more ideas?
 
So it opened the Attendee form, but when you close it, it doesn't save?

Do you have any buttons or anything on the Attendee form that call the 'Save' function?

Leslie
landrews@metrocourt.state.nm.us

There are 10 types of people in the world -
those who understand binary
and
those who don't!
 
What it does is create a dialog box with the form inside it. Along the right side is a bar that contains two buttons: OK and Close. Neither of these buttons will save it. Having those buttons there will confuse people. I need to not have those buttons there, and would be happy to include buttons within the form itself.
 
Ok, try this instead:

Sub Click(Source As Button)
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim uidoc As NotesUIDocument
Set db = session.CurrentDatabase
Set doc = db.CreateDocument
doc.Form = "Attendees"
set uidoc = doc
Call doc.Save( True, True )
End Sub

This will create a new document and save it

Leslie
landrews@metrocourt.state.nm.us

There are 10 types of people in the world -
those who understand binary
and
those who don't!
 
Plus...if I try to do more than one at once it gives me an error that says i already have a document with that unique identifier.
 
On line 9 it says Type mismatch on Doc...

AIM: tfisbrian
 
try uidoc = workspace.currentdocument

Leslie
landrews@metrocourt.state.nm.us

There are 10 types of people in the world -
those who understand binary
and
those who don't!
 
Error when trying to click the button: Variant does not contain object.
 
i'll look into it a bit more, I was about to leave yesterday afternoon when we were posting. I'll let you know what I find.

Leslie
landrews@metrocourt.state.nm.us

There are 10 types of people in the world -
those who understand binary
and
those who don't!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top