Ok, few more questions real quick:
1) Is it always size and color for the two axes?
2) Is the database structure set in stone?
I hate to make too many assumptions, but assuming the axes are always color and size and also assuming we can design or redesign the database, then I think I would look at doing something like:
Database Design:
Product Table:
product_id - autonumber
product_name - text
product_image - text - url to image
product_desc - text
plus any addtl fields you need
Color Table:
color_id - autonumber
color_name - text
color_html - text to hold the color value as a #RRGGBB value
Size Table:
size_id - autonumber
size_name - text
We now have two choices, we can either create a single table to hold a product id, color id, and size id or we can create two seperate tables. This is dependant on how products will be available. If we need to be able to say we sell red, white, and green shirts in sizes XL and M then two tables is fine (ie, one record for every product/size combination and one record for every product/color combination). If we need to be able to say we offer the combinations listed above except green in M, then we would be better off with one table (ie, a single record for every product, color, size combination)
ProductInstance Table:
prodinst_id - autonumber
product_id - number - key to product record
color_id - number - key to color record
size_id - number - key to size record
OR
ProductColor Table:
prodcolor_id - autonumber
product_id - number - key to Product record
color_id - number - key to Color record
ProductSize Table:
prodsize_id - autonumber
product_id - number - key to product record
size_id - number - key to Size record
Admin tool logic:
First you would need three simple pages that allow the user to add/modify a product, a color, or a size. Those would be fairly straightforward.
The complicated one would be the one to handle the color/size/product combinations. This obviously depends on which table layout you use.
If you do two seperate tables then you could offer two sets of checkboxes on the Product admin page, one to select colors and one to select sizes. Updating these values should be fairly easy since you have the product information on the page and would just need to add or delete records from the ProductSize and ProductColor tables.
The best way for the one table method would probably be to do something similar to the grid that you want to make for the user, except with checkboxes to denote whether a product is available in a size/color. That would look something like:
Code:
<%
Option Explicit
'assume this page was passed a product_id in the querystring
Dim product_id
product_id = Request.QueryString("product_id")
If product_id = "" Then
Response.Write "You have not selected a valid product, please return to some other page...etc etc, this is an error message"
Response.End
End If
Dim obj_conn, str_sql
Dim rs_prodinst, arr_prodinst
Dim rs_color
Set obj_conn = Server.CreateObject("ADODB.Connection")
obj_conn.Open "my connection string"
'we need all the colors for the top of the table and we need all combinations of color and size, as well as the prod_inst if it is available
str_sql = "SELECT color_id, color_name, color_html FROM Color ORDER BY color_name"
Set rs_color = obj_conn.Execute(str_sql)
str_sql = "SELECT Color.color_id, Size.size_id, size_name, prodinst_id " & _
"FROM (Color, Size) LEFT JOIN ProductInstance ON ProductInstance.color_id = Color.color_id AND ProductInstance.size_id = Size.size_id AND ProductInstance.product_id = " & product_id & " " & _
"ORDER BY size_name, Color.color_name"
'convert to an array for faster processing
arr_prodinst = rs_prodinst.GetRows()
Set rs_prodinst = Nothing
If Not rs_color.EOF The rs_color.MoveFirst
'start an editing form - obviously this needs to be formatted nicely and prettied up but this is just an example
%>
<form method="POST" action="somesubmissionpage.asp">
<table>
<tr>
<th></th>
<%
'output color column names
Do Until rs_color.EOF
Response.Write "<th style=""background-color: " & rs_color("html_color") & """>" & rs_color("color_name") & "</th>"
rs_color.MoveNext
Loop
%>
</tr>
<%
'now output entries for every color/size combination with a checkbox
Dim row_ctr, last_size
For row_ctr = 0 to UBound(arr_prodinst,2)
'if the size has changed it's time to start a new row
If arr_prodinst(1,row_ctr) <> last_size Then
Response.Write "<tr><th>" & arr_prodinst(2,row_ctr) & "</th>"
last_size = arr_prodinst(1,row_ctr)
End If
'output a checkbox for this color/size combination
Response.Write "<td><input type=""checkbox"" name=""size_color"" value=""" & arr_prodinst(1,row_ctr) & "_" & arr_prodinst(0,row_ctr) & """"
'if there is a prodinst_id then check the box to show it's already selected in the database as a valid combination - this may not be a valid way to check, I'm feeling a little rusty today
If arr_prodinst(3,row_ctr) <> "" Then Response.Write " checked"
Response.Write "></td>" 'end the checkbox and column
'if this is the last entry in the array, end the row
If row_ctr = UBound(arr_prodinst,2) Then
Response.Write "</tr>"
ElseIf arr_prodinst(1,row_ctr+1) <> last_size Then
'if the size is going to change for the next record, end this row
Response.Write "</tr>"
End If
Next
'cleanup the database stuff
Set rs_color = Nothing
obj_conn.Close
Set obj_conn = Nothing
%>
</table>
</form>
As you can see this is fairly complicated. Actually submitting the changes will be as well. Personally I'm not sure I wouldn't be talking to the customer about simplifying their needs, but hey, we've come this far might as well keep going.
In fact this has gotten to the point where it is complicated enough that I would have to seriously sit down and spend some time on it rather than just trying to write the whole thing on the fly. Your answers to the two questions I had above will help and I'll check back a little later as I have to take a break and get some work done
-T
PS: Sometimes I wonder why I don't make buckets of money

(I'm sure someone will post back to explain it though)