Sorting on a Linked Field in an HTML View

Sorting on a Linked Field in an HTML View

Hello everyone,

I was hoping that someone could help me out with an issue I am having with an HTML script that I wrote for a page. In this script, I use two forms (AVLBeerManager & Beer_Locator) to create an html view that displays a list of beers with relevant information (ABV, Description, etc.).

Beer_Locator is where location information resides (i.e. @ which bar has which beer)
AVLBeerManager is where beer information resides (i.e. abv, desc, etc)

I iterated records on both tables, linking on the field Beer_Name, which exists in both tables and functions essentially as a Unique Key. The problem is, I need to sort the HTML view on a field that is contained in the second iterated function (namely, Style). I haven't determined a way to do this and am starting to get really frustrated. I was hoping that one of the superstars on the forum could help me, as I'm sure this is something super easy that I am just missing. Code is below:

<%for each d in Beer_Locator  [(((Currently_On == "Yes" && Served == "On Tap") && Beer_Location == "Thirsty Monk Biltmore Park") && Tap_Location == "Main")] sort by  Beer_Name  range from 1 to 20
    {
        for each c in AVLBeerManager  [Beer_Name == d.Beer_Name] range from 1 to 20
        {
        %>                                                                                                                                                                         
  <tr class="row1">
  <td width="36%"><%=d.Beer_Name%> </td> <td width="33%" class="stylebox"><%=c.Style%> </td> 
  
<td width="8%"><%=c.ABV%></td><td width="23%"><%=d.Price%> / <%=d.Half_Pour%></tr>
  <tr class="row2"><td align="left" colspan="4"><%=c.Location%> <%=c.Beer_Description%> </td>

  </tr> 
  </center>                                                                                                                                                                                                        
 <% } } }%>

Thanks in advance, guys