How to sort a continuous form by combo lookup text?
Posted on 2006-04-11
I have a "products" table displayed on a continuous form. Each product is tied to a department: the form uses a combo box to tie department IDs to a list of departments (nice, basic normalization!)
ID = 1 Name = "Charmin" DeptID=1
ID = 2 Name = "Bunny Luv Peeled Carrots" DeptID =2
deptID = 1 deptName = "Dry Goods"
deptID = 2 depName = "Produce" etc.
The form recordSource is PRODUCT: the combo box controlsource is "deptID", with a rowsource query "select deptID, deptName from dept". The combo is bound to the first field, with field widths 0;1")
OF course, data is entered into products in a random order.
Q: is there some way to sort the data initially by the DEPTNAME rather than the NUMERIC VALUE stored -- and still be able to edit the data? I thought I'd seen some nifty way to do this with an unbound dlookup, but darned if I can recreate it... When I change the form recordsource from PRODUCT to a join, the data is no longer editable...