Solved

Dialog Box to enter new students to one field.

Posted on 2006-06-21
4
250 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now