Hello,
I am using CFquery to insert data from a form into an Access
database. If all fields are not entered a message is returned
indicating that "Element X is undefined in FORM." The Access
database fields allow null values. If I entered data into every
field it works fine. I have tried using cfqueryparam to check for
null but have had no luck. My code is below. Any help is greatly
appreciated.
INSERT INTO ISDSUserSurvey
(1)
VALUES <cfqueryparam value="#trim(form.1)#"
cfsqltype="CF_SQL_VARCHAR"
null="#YesNoFormat(not(len(trim(form.1))))#"/>
and this code:
INSERT INTO ISDSUserSurvey
(1)
VALUES (<cfif IsDefined("#Form.1#") AND "#Form.1#" NEQ
"">
'#Form.1#',
<cfelse>
NULL,
</cfif>