when i replace this line our computer hangs

rs.Open " SELECT DISTINCT ITEM_CODE, PRODUCTNAME, UNIT FROM PARTDETAIL ORDER BY UCASE(LEFT(TRIM(ITEM_CODE),1)), VAL(MID(TRIM(ITEM_CODE),2,10)) ", con, adOpenDynamic, adLockOptimistic

omit the keyword DISTINCT b'cos the PARTDETAIL table must have distinct values only (i think) as the item_code field is set to Primary Key.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.