Well i could not fix it so changed the form to include a search box rather than choosing from the datagrid. (looks better)
I would be interested in knowing why this happens. It seems that the primary key groups next to a foreign key in the next collumn.
For example
PK 6,7,8,56,9,10
FK 2,3,7, 7...