Library log
Library log
I'm attempting to develop a database for a tool library for our little non-profit following the closure of Dabble. I've tried the library manager application but wish for a somewhat different structure. We have a PEOPLE form (borrowers) and a TOOLS form, each of which track vital information. I would like a LIBRARY_LOG form, where each entry is a borrowing event and easy to fill out by our librarians when they are busy. The log should be related to PEOPLE1 by a one-to-one, but to TOOLS by a one-to-many since any one borrower may take multiple tools.
I have the PEOPLE relationship setup where the librarian can type part of a name or ID number into a field which populates a lookup list of entries that contain what was typed in, and the librarian can select the appropriate borrower there.
- on user input
- {
- memberlist = (People1[First_Name.contains(input.Member_check)].for_lookup).getall();
- Member_Lookup1:ui.add(memberlist);
- }
I want to do the same for tools (let the librarian type in part of a tool name, then select the actual tool in a lookup field), but for multliple tools with different descriptions. This is as close as I've gotten. They can type in part of the description, which updates the lookup list to select a tool. That selection gets added to a list (borrlist) which is used to populate a third field (Tools_borrowed). But every time something gets typed into Tool_description it's forced to recreate borrlist (line 19 below) which de-populates the list and I end up in a never-ending cycle. I can't seem to create borrlist earlier. Anybody have any ideas to fix this strategy, or new strategies to get the one-to-many relationship I'm looking for (knowing that 2000+ tools is too many to list as radio buttons or in an unfiltered list)?
- Tool_description
- (
- displayname = "Tool description"
- type = text
- width = 200px
- on user input
- {
- toollist = (tools[Tool_Description.contains(input.Tool_description)].Tool_Description).getall();
- Tool_selection_lookup1:ui.add(toollist);
- }
- )
- Tool_selection_lookup1
- (
- displayname = "Tool selection lookup1"
- type = radiobuttons
- values = tools.Tool_Description
- on user input
- {
- borrlist = List();
- //need to NOT recreate empty list on subsequent selections
- borrlist.add(input.Tool_selection_lookup1);
- Tools_borrowed:ui.add(borrlist);
- for each y in borrlist
- {
- Tools_borrowed.select(y);
- }
- }
- )
- Tools_borrowed
- (
- displayname = "Tools borrowed"
- type = list
- values = {"Tool1", "Tool2", "Tool3"}
- height = 60px
- width = 206px
- )