When this error shows up, without clicking the OK button,
Press Ctrl + (Break/Pause) button and debug each statement execution by pressing F8 key (executing one line at a time for each press of F8 key) till the line of error in Grd_LeaveCell event is highlighted
and post the highlighted line in Grd_LeaveCell() event
Also change the following statement in RED your MR form.
Private Sub SetProductValues()
Dim rs As New ADODB.Recordset
On Error GoTo SetProductValues_Error
rs.Open " SELECT ITEM_CODE, PRODUCTNAME, MAXOFUNIT FROM PARTDETAIL WHERE ITEM_CODE = '" & Grd.TextMatrix(Grd.Row, cItemCode) & "' ", con, adOpenKeyset, adLockReadOnly
If rs.BOF = False Then
Grd.TextMatrix(Grd.Row, cItemName) = rs!ProductName
Grd.TextMatrix(Grd.Row, cUnit) = rs!MAXOFUNIT & ""
End If
SetProductValues_Done:
If rs.State Then rs.Close
Set rs = Nothing
Exit Sub
SetProductValues_Error:
Call Process_Error(MODULE_NAME, "SetProductValues")
Resume SetProductValues_Done
End Sub