I change and still inserting but not updateing,
If DCount("*", "cost", "order_no='" & Me.Text0 & "' AND pallet_cost=" & Me.Text2) = 0 Then
DoCmd.SetWarnings False
DoCmd.RunSQL "insert into cost ([order_no], [pallet_cost]) Values ([Forms]![Form3]![Text0], [Forms]![Form3]![Text2])"
Else
DoCmd.RunSQL "Update cost set pallet_cost = [Forms]![Form3]![Text2] where order_no = [Forms]![Form3]![Text0]"
End If