private void formScreen(String action,
                              Connection database,
                              HttpSession session,
                              HttpServletRequest request,
                              PrintWriter webPageOutput)
      {
      int orderNumber=0;
      String orderName="";
      Routines.tableStart(false,webPageOutput);
      if("Change Order".equals(action))
        {
        try
          {
          Statement sql=database.createStatement();
          ResultSet queryResult;
          queryResult=sql.executeQuery("SELECT PlayOrderNumber " +
                                       "FROM playorders " +
                                       "ORDER BY Sequence DESC");
          int tempOrderNumber=0;
          while(queryResult.next())
               {
               tempOrderNumber=queryResult.getInt(1);
               int currentSequence=0;
               if("true".equals(request.getParameter(String.valueOf(tempOrderNumber))))
                 {
                 queryResult=sql.executeQuery("SELECT PlayOrderNumber,PlayOrderName " +
                                              "FROM playorders " +
                                              "WHERE PlayOrderNumber=" + tempOrderNumber);
                 if(queryResult.first())
                   {
                   orderNumber=queryResult.getInt(1);
                   orderName=queryResult.getString(2);
                   }
                 else
                   {
				   Routines.writeToLog(servletName,"Unable to find order (" + tempOrderNumber + ")",false,context);	
                   }
                 }
               }
            }
       catch(SQLException error)
            {
			Routines.writeToLog(servletName,"Unable to retrieve playorder: " + error,false,context);	
            }
      Routines.tableHeader("Amend details of Order",2,webPageOutput);
      }
      if("New Order".equals(action))
        {
        Routines.tableHeader("Enter details of new Order",2,webPageOutput);
        }
      Routines.tableDataStart(true,false,false,true,false,5,0,"scoresrow",webPageOutput);
      webPageOutput.print("Name");
      Routines.tableDataEnd(false,false,false,webPageOutput);
      Routines.tableDataStart(true,false,false,false,false,75,0,"scoresrow",webPageOutput);
      webPageOutput.print("<INPUT TYPE=\"TEXT\" NAME=\"orderName\" SIZE=\"10\" MAXLENGTH=\"10\" VALUE=\"" + orderName + "\">");
      Routines.tableDataEnd(false,false,true,webPageOutput);
      Routines.tableEnd(webPageOutput);
      webPageOutput.println(Routines.spaceLines(1));
      Routines.tableStart(false,webPageOutput);
      Routines.tableHeader("Actions",1,webPageOutput);
      Routines.tableDataStart(true,true,false,true,false,0,0,"scoresrow",webPageOutput);
      if("New Order".equals(action))
        {
        webPageOutput.println("<INPUT TYPE=\"SUBMIT\" VALUE=\"Store New Order\" NAME=\"action\">");
        }
      else
        {
        webPageOutput.println("<INPUT TYPE=\"SUBMIT\" VALUE=\"Store Changed Order\" NAME=\"action\">");
        }
      webPageOutput.println("<INPUT TYPE=\"SUBMIT\" VALUE=\"Cancel\" NAME=\"action\">");
      Routines.tableDataEnd(false,false,true,webPageOutput);
      Routines.tableEnd(webPageOutput);
      webPageOutput.println("<INPUT TYPE=\"hidden\" NAME=\"jsessionid\" VALUE=\"" + session.getId() + "\">");
      webPageOutput.println("<INPUT TYPE=\"hidden\" NAME=\"orderNumber\" VALUE=\"" + orderNumber + "\">");
      webPageOutput.println("</FORM>");
      }