miss veena
kindly find the po.zip edit and uplaod

check out the file i have altered and uploaded it.

I have altered the Form_Load()

and

added a new procedure MSFlexGrid1_Click()

Sir
You have seen po.frm code now problem is that product_id
is not comming in sorted order.
rs.Open " SELECT DISTINCT ITEM_CODE, PRODUCTNAME, UNIT FROM PARTDETAIL ", con, adOpenDynamic, adLockOptimistic

since it starts with a characted then no kindly help me
in order to sort product_id for user convenience.

rs.Open " SELECT DISTINCT ITEM_CODE, PRODUCTNAME, UNIT FROM PARTDETAIL ORDER BY ITEM_CODE ", con, adOpenDynamic, adLockOptimistic

Kindly find the imp.doc

Assuming That the First letter only in the Item_Code is an Alphabet u can write the following query to sort in the way u have asked.

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
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.