Optionfields with CFRONT

I’m trying to import data into Navision via cfront. Everything goes well, except for the option fields. When I import the integer value with the function AssignField my VB exe crashes. When I try to import the text value of the option string Navision cfront ocx gives me an dataconversion error. I don’t understand where this is coming from because the Navision cfront ocx uses the variant data type. Does anyone have an idea how to solve this ? Thanks in advance Pieter

Did you try to pas a Variant instead of an integer? Anolis Sittard Netherlands

This behavior of CFront.ocx is well known. NEVER use constant assigment: …AssignValue(…1…) ALLWAYS use temporary variable: dim tmp as integer …AssignValue(…tmp…) I don’t know why, but think that cfront.ocx can’t handle values from stack. (all constants are placed in stack, defined vars - in data segment)

Thanks, that did the trick. I read my value into a var. And used Assign (… var …) instead of using the value.