Because you are referring to a column in the combo - all columns are text.why it is accepting a numeric value in text
Even if you referred to the control value by using
If RST.Fields(3) = Me.castcode Then
you will still get a text value - because the control is unbound and cannot determine the datatype so it defaults to text
if you want a numeric value use the cLng function to convert it to a number, or bind the control to a numeric field