<script language="VBSCRIPT" type="text/vbscript"> Dim oVFPForm Function SetFormRef(lotheForm) Set oVFPForm = lotheForm End Function </script> <script language="javascript" type="text/javascript"> var jVFPForm; function SetFormRef(lotheForm) { jVFPForm = lotheForm; } </script>Calling the VBScript version from VFP with ".DOCUMENT.Script.SetFormRef(THISFORM)" works fine but the same line used against the Javascript function raises an OLE error. I don't think the code within the function is the problem - even an empty version of the function behaves the same. Anyone know what the problem might be?