The problem is likely with the value of trim(form.txtMyID). Directly using FORM variables is not a good idea, for a variety of reasons. It is better to initialize all your variables as uniquely named local page variables, and then assign values from FORM or other inputs after validating them.
<cfset ThistxtMyID = "0">
<cfif IsDefined("FORM.txtMyID") AND IsValid("integer", Trim(FORM.txtMyID)>
<cfset ThistxtMyID = Trim(FORM.txtMyID)>
</cfif>
Be sure to validate ThistxtMyID before you try to use it:
<cfif ThistxtMyID EQ "0">
handle this error condition, don't query the database
</cfif>