Solved

Dialog Box to enter new students to one field.

Posted on 2006-06-21
4
253 Views
Last Modified: 2013-12-18
Have a form where I need to enter the attendance for a class and some user info. I want to do this using a Dialog Box that pops up from say an Add Student button. I will have something like a field for Name, Title and ID. How do I go about setting this up so a trainer can click on the button and a new student will be appended to a common single multi value field. THe way I have it not I have to create a huge table of fields, once row for each student, trying to estimate the greatest number in a class. I know this is not the best way and have seend it done with a clean dialog box, but not sure how exactly it is done.

Any advice is appreciated.

Joe
0
Comment
Question by:jforget1
4 Comments
 
LVL 63

Expert Comment

by:SysExpert
ID: 16955423
I would create a docment for each stdent, and then have a view that can be used as a lookup.
This is simple, and will alow for added functionality in the future.
You can have a Class  ID and other identifiers so that it will be easy to do a lookup.

I hope this helps !
0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 250 total points
ID: 16955627
You can do it in a DialogBox. I have a set of functions and classes that do exactly what you want, even more, because most likely you need both Add and Remove. There is a similar set in the Sandbox somewhere (less advanced of course ;). See
    http://www-10.lotus.com/ldd/sandbox.nsf/ecc552f1ab6e46e4852568a90055c4cd/f2acda4419a5e3cd00256c0e00314e05?OpenDocument
0
 
LVL 18

Assisted Solution

by:marilyng
marilyng earned 250 total points
ID: 16956811
As sjef says, you can do it, but it's a matter of keeping a before and after field.

You have a set of fields that display the nice student information, computed for display, new line for each entry.

Name ->@Word(MyList;"|";1)          Class  ->@Word(MyList;"|";2)      ID->@Word(MyList;"|";3)
Bob                                               Class1                                         BBB
Mary                                             Class2                                         CCC

You have the field (myList) that holds the list:  "Name|Class|ID"
Bob|Class1|BBB
Mary|Class2|CCCC

Then you have three buttons:  Add a student, update a student, remove a student.
And finally you have the magic, let's number the student array so we can figure out which  (although you can cycle through to find the correct record, now in 6.5)  


To add a student, you simply parse the three fields and add it to the list;
To remove one, you select an entry from the list and then remove it
Edit, you select an entry from the list, and remove the entry from the list, but put the entry values back in the fields.

Add Button
---------------------------------------------------------
List:=@Implode(Name:Class:ID;"|");
NewList:=@If(MyList="";List;MyList:List);
@SetField("MyList";NewList);
@SetField("Name";"");
@SetField("Class";"");
@SetField("ID";"");
@Command([ViewRefreshFields])

Remove Button
-----------------------------------------------------------
Nums:="0":"1":"2":"3":"4":"5":"6":"7":"8":"9";
TheseElements:=@Elements(MyList);
ThisList:=MyList;
NumList:=@Subset(@Subset(@Text(@TextToNumber(Nums*+Nums*+Nums));-999);theseElements);
List:=NumList + (". " + @Word(thisList;"|";1));
Selected:=@Prompt([OkCancelList];"Select an Entry";"Select an entry to Remove";"";List);
@If(Selected = "";@Return("");"");
k:=@TextToNumber(@LeftBack(Selected;"."));
Entry:=MyList[k];
NewList:=@If(Entry !="";@Replace(MyList;Entry;"");MyList);
@SetField("MyList";NewList);
@SetField("Name";"");
@SetField("Class";"");
@SetField("ID";"");
@Command([ViewRefreshFields])


Edit Button
-----------------------------------------------------------
Nums:="0":"1":"2":"3":"4":"5":"6":"7":"8":"9";
@If(@Elements(MyList)<1;@Return(@Prompt([Ok];"No List";"There is nothing to edit yet!"));"");
TheseElements:=@Elements(MyList);
ThisList:=MyList;
NumList:=@Subset(@Subset(@Text(@TextToNumber(Nums*+Nums*+Nums));-999);theseElements);
List:=NumList + (". " + @Word(thisList;"|";1));
Selected:=@Prompt([OkCancelList];"Select an Entry";"Select an entry to Remove";"";List);
@If(Selected = "";@Return("");"");
k:=@TextToNumber(@LeftBack(Selected;"."));
Entry:=MyList[k];
NewList:=@If(Entry !="";@Replace(MyList;Entry;"");MyList);
@SetField("MyList";NewList);
@SetField("Name";@Word(Entry;"|";1));
@SetField("Class";@Word(Entry;"|";2));
@SetField("ID";@Word(Entry;"|";3));
@Command([ViewRefreshFields])

------------------------------------------------------

Now, I didn't go through and test for BLANK values, so you might have to do that, but you get the idea.

0
 

Author Comment

by:jforget1
ID: 16960186
Thanks to all I am sure between all this information I will be able to get a good solution together.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Lotus Notes to MS Exchange mailfile migration 4 60
Resolving notes group email address to old name with subdomain 10 151
Send email lotus notes / VBA 6 173
Domino Server 2 80
You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question