I'm trying to populate a control from an external form with a string value on button click - this is working perfectly when there is already existing text, however if there is nothing then it is treated as a null value and therefore returns a Type Mismatch error.
I thought I would be able to work around this by using:
Nz(Forms!frmSpecifications!boxScratchpad.value, "") = "Text string"
But this hasn't worked.
Could it be to do with how I am calling the control, or the properties of the control itself?
UPDATE: After looking into this a bit more I have pinpointed the issue to a SQL query execution earlier in the code which runs an update statement on the same table that boxScratchpad normally gets its data from (although the field which is fed into boxScratchpad is not actually updated). If I comment out this code so that the update statement doesn't run, boxScratchpad populates successfully. It seems like there could be a conflict between the table being updated and boxScratchpad being assigned a new value within the same code?
external.control.text = Nz(Forms!frmSpecifications!boxScratchpad.value, "Text string"). - GSerg