Link to home
Start Free TrialLog in
Avatar of jdines
jdinesFlag for United States of America

asked on

ODBC Error Code = 37000 (Syntax error or access violation)

Hello,
  I am having an issue where some users are receiving the following error when using a particular form: Error Diagnostic Information

ODBC Error Code = 37000 (Syntax error or access violation)

[Microsoft][ODBC SQL Server Driver][SQL Server]Line 41: Incorrect syntax near ''.

The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (437:2) to (437:50).

Date/Time: 09/28/09 09:19:40
Browser: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6; .NET CLR 1.1.4322)
Remote Address: 76.9.124.2
HTTP Referrer: http://www.realestateone.net/MyWebLinks/203/form_203.cfm?form_type=new 
 
I included all of the code, not sure what you needed, I am fairly new to this  This worked prior to adding additional fields (lease infomation section), nothing else was changed.  Thanks in advance for your assistance.

<!--- SS#s were taken out on 12/20/05 as per Jodi --->
 
<style type="text/css">
<!--
 
.TextBox { font-family:arial; font-size: 8pt}
.TextBoxSelected { font-family:arial; font-size: 8pt; background-color: ffffCC}
 
-->
</style>
 
 
<cfif NOT ISDEFINED("session.pwd") >
	<cflocation url="../index.cfm">
	<cfabort>
</cfif> 
 
<!--- To prevent duplicate records, disable the browser's back button--->
<!--- <script language="JavaScript">
	javascript:window.history.forward(1);
</script>  --->
 
 
<cfif parameterExists(form.mls_num) AND #form.mls_num# NEQ ''>
	
	<!--- Get Listing Information --->
	<cfquery name="GetRecordByMLS" datasource="#gDSN#" maxrows="1">
	SELECT * FROM all_listings_new
	WHERE mls = '#form.mls_num#' 
						 
	</cfquery>
	
<!--- check for the agent name, if there is a comma then first part is the lastname --->
	<cfset comma = #Listcontains(GetRecordByMLS.agentName_MLS, ",", 1)#>
		
	<cfif #comma# EQ '0'>
		<cfset firstname='#Listfirst(GetRecordByMLS.agentName_MLS, " ")#'>
		<cfset lastname='#Listlast(GetRecordByMLS.agentName_MLS, " ")#'>
	<cfelse>
		<cfset firstname='#Listlast(GetRecordByMLS.agentName_MLS, " ")#'>
		<cfset lastname='#Listfirst(GetRecordByMLS.agentName_MLS, ",")#'>
	</cfif>
	
<!--- Set Listing variables --->
	<cfif GetRecordByMLS.RecordCount>
		<cfset mls_value = '#GetRecordByMLS.mls#'>
		<cfset address_value = '#GetRecordByMLS.address#'>
		<cfset city_value = '#GetRecordByMLS.city#'>
		<cfset state_value = '#GetRecordByMLS.state#'>
		<cfset zip_value = '#GetRecordByMLS.zip#'>
		<cfset list_date_value = '#GetRecordByMLS.date_added#'>
		<cfset list_price_value = '#GetRecordByMLS.list_price#'>
		<cfif (form.list_type EQ '3') ><!---AND (GetRecordByMLS.REO_listing EQ 'N') 0 --->
			<cfset OB_firstname_value='#firstname#'><!---  --->
			<cfset OB_lastname_value='#lastname#'><!---  --->
			<cfset OB_compname_value='#GetRecordByMLS.officename_MLS#'><!---  --->
		<cfelseif (form.list_type EQ '1' OR form.list_type EQ '2') ><!---AND (GetRecordByMLS.REO_listing EQ 'Y') 1 --->
			<cfset firstname_Value='#firstname#'>
			<cfset lastname_Value='#lastname#'>
		<!--- <cfelse>	
			<table align="center" width=350>
			<tr><td>&nbsp;<br><br><br></td></tr>
			<tr><td><b>There is an error in the input of MLS # <cfoutput>#form.mls_num#</cfoutput>OR the selection of the listing type</b></td></tr>
			<tr><td>Please <a href="javascript:history.go(-1)">Go Back</a> and try again.</td></tr>
		</table>
		<cfabort>  --->
		</cfif>
		
	<cfelse>
		<cfset mls_value = ''>
		<cfset address_value = ''>
		<cfset city_value = ''>
		<cfset state_value = ''>
		<cfset zip_value = ''>
		<cfset list_date_value = ''>
		<cfset list_price_value = ''>	
		<cfset OB_firstname_value = ''>
		<cfset OB_lastname_value = ''>
		<cfset OB_compname_value = ''>
		<cfset firstname_value = ''>
		<cfset lastname_value = ''>
	</cfif>	
	
	<cfif #GetRecordByMLS.RecordCount# EQ '0'>
		<table align="center" width=350>
			<tr><td>&nbsp;<br><br><br></td></tr>
			<tr><td><b>No record found with MLS # <cfoutput>#form.mls_num#.</cfoutput></b></td></tr>
			<tr><td>Please <a href="javascript:history.go(-1)">Go Back</a> and try again.</td></tr>
		</table>
		<cfabort> 
	
	</cfif>
	
<cfelse><!--- if mls# is not entered, but new form opened --->
	<cfset office_id_value = ''>
	<cfset payno_value = ''>
	<cfset firstname_value = ''>
	<cfset lastname_value = ''>
	<cfset mls_value = ''>
	<cfset address_value = ''>
	<cfset city_value = ''>
	<cfset state_value = ''>
	<cfset zip_value = ''>
	<cfset list_date_value = ''>
	<cfset list_price_value = ''>	
	<cfset OB_firstname_value = ''>
	<cfset OB_lastname_value = ''>
	<cfset OB_compname_value = ''>
	<cfset firstname_value = ''>
	<cfset lastname_value = ''>
</cfif>
 
 
<html>
<head>
	<title>Form 203</title>
	
</head>
 
 
<script language="javascript">
	         
	function formCheck(form203)  {
	 	if ((form203.property_street.value == "") || (form203.property_city.value == "") || (form203.property_state.value == ""))     {
                alert ("Please enter the Property's Street Address, City,  and State.")
                form203.property_street.focus()
                return false
	        } 
        if (form203.processedby.value == "")        {
                alert ("Please enter your name.")
                form203.processedby.focus()
                return false
        }   
		
	}
	
		<!--
//Let Only Numbers in
function checkIt(evt) {
     evt = (evt) ? evt : window.event
          var charCode = (evt.which) ? evt.which : evt.keyCode
               if (charCode > 31 && (charCode < 48 || charCode > 57)) {
                    alert('This field accepts numbers only.')
                    status = "This field accepts numbers only."
                         return false
                    }
               status = ""
          return true
}
//-->	
		
</script> 
	
<script language="javascript">
 
	function isNumberString(InString){
		if (InString.length==0) return (false);
					
		var RefString="1234567890";
		for (Count=0; Count < InString.length; Count++) {
			TempChar = InString.substring (Count, Count+1);
			if (RefString.indexOf(TempChar, 0)== -1)
				return (false);
		}
		
		return (true);
	}
	
	function CheckPhoneNumber(TheNumber) {
		var GoodChars = "0123456789()-/ ";
		var i = 0;
		if (TheNumber.length < 10) return (false);
					
		for (i =0; i < TheNumber.length; i++) {
			if (GoodChars.indexOf(TheNumber.charAt(i)) == -1) {
		
				return (false);
				} 
			} // End for loop
		return (true);
		}
 
 
	function formCheck2(form203)  {
			if(form203.seller_comp.value == ""){
			   if ((form203.seller_firstname1.value == "") || (form203.seller_lastname1.value == "") )  
		  		 {
	                alert ("Please enter the Seller's First Name and Last Name.")
	                form203.seller_firstname1.focus()
	                return false
	       		 } 
				
			}
			if ((form203.seller_street.value == "") || (form203.seller_city.value == "") || (form203.seller_state.value == ""))     {
	                alert ("Please enter the Seller's Street Address, City,  and State.")
	                form203.seller_street.focus()
	                return false
		        } 
	
			if ((!isNumberString(form203.seller_zip.value)) || (form203.seller_zip.value.length != 5))  {
	                alert ("Please enter the Seller's Zip Code correctly.")
	                form203.seller_zip.focus()
					return false
				}
			
					
			if ((form203.property_street.value == "") || (form203.property_city.value == "") || (form203.property_state.value == ""))     {
	                alert ("Please enter the Property's Street Address, City,  and State.")
	                form203.property_street.focus()
	                return false
		        } 
			if ((!isNumberString(form203.property_zip.value))  || (form203.property_zip.value.length != 5))  {
	                alert ("Please enter the 5 digit Property's Zip Code correctly.")
	                form203.property_zip.focus()
	                return false
		        } 
			if (form203.property_ADate.value == "")      {
	                alert ("Please enter the Accept Date and the Sold Price correctly.")
	                form203.property_ADate.focus()
	                return false
		        } 	
			if ((form203.property_SPrice.value == "") || (!isNumberString(form203.property_SPrice.value)) )     {
	                alert ("Please enter the Sold Price correctly. Only numbers are accepted")
	                form203.property_LPrice.focus()
	                return false
		        } 	
			
			if ((form203.property_LPrice.value != "") && (!isNumberString(form203.property_LPrice.value)) )     {
	                alert ("Please enter the List Price correctly. Only numbers are accepted.")
	                form203.property_LPrice.focus()
	                return false
		        } 
			
				
			if(form203.buyer_comp.value == ""){
				if ((form203.buyer_firstname1.value == "") || (form203.buyer_lastname1.value == ""))     {
	                alert ("Please enter the Buyer's First Name and Last Name.")
	                form203.buyer_firstname1.focus()
	                return false
			        } 
					
				}
			if ((form203.buyer_street.value == "") || (form203.buyer_city.value == "") || (form203.buyer_state.value == ""))     {
	                alert ("Please enter the Buyer's Street Address, City,  and State.")
	                form203.buyer_street.focus()
	                return false
		        } 
			if ((!isNumberString(form203.buyer_zip.value ) ) || (form203.buyer_zip.value.length != 5)) {
	                alert ("Please enter the 5 digit Buyer's Zip Code correctly.")
	                form203.buyer_zip.focus()
	                return false
		        } 
			if (form203.buyer_homephone.value ==""){
				alert ("Please enter the Buyer's Home Phone correctly.  Format (555)555 5555")
				form203.buyer_homephone.focus()
				return false
				}
				
			if (form203.buyer_email.value ==""){
				alert ("Please enter the Buyer's email address")
				form203.buyer_email.focus()
				}
				
				
		
			<!--- (!CheckPhoneNumber(form203.buyer_homephone.value)  )     {
		                alert ("Please enter the Buyer's Home Phone correctly. Format(555)555 5555")
		                form203.buyer_homephone.focus()
		                return false
		        } 
			--->
				
			if ((form203.list_type.value == 1) ){
				if ((form203.gr_comm_percentage.value == "") && (form203.gr_comm_dollars.value == "")){
					alert ("Please enter Gross Commission percentage or Dollars")
					form203.gr_comm_percentage.focus()
					return false
					}
				if ((form203.OB_percentage.value == "") && (form203.OB_dollars.value == "")){
					alert ("Please enter O/B Commission percentage or Dollars")
					form203.OB_percentage.focus()
					return false
					}
			  }  
			if ((form203.list_type.value == 2) ){
				if ((form203.gr_comm_percentage.value == "") && (form203.gr_comm_dollars.value == "")){
					alert ("Please enter Gross Commission percentage or Dollars")
					form203.gr_comm_percentage.focus()
					return false
					}
				if ((form203.REO_list_percentage.value == "") && (form203.REO_list_dollars.value == "")){
					alert ("Please enter REO Lisitng Agents Commission percentage or Dollars")
					form203.REO_list_percentage.focus()
					return false
					}
				if ((form203.REO_sale_percentage.value == "") && (form203.REO_sale_dollars.value == "")){
					alert ("Please enter REO Selling Agents Commission percentage or Dollars")
					form203.REO_sale_percentage.focus()
					return false
					}
			  }  
			    
	   		if ((form203.comp_percentage.value == "") && (form203.comp_dollars.value == "")){
					alert ("Please enter REO Gross percentage or Dollars")
					form203.comp_percentage.focus()
					return false
			  }
			  
			  
			 if (document.form203.order_cont.checked == true	&& document.form203.Style.selectedIndex == 0){
				alert("Please select the sytle of Order Continuity");
				document.form203.Style.focus();
				return false;
			   }
			
			if (form203.processedby.value == "")        {
	                alert ("Please enter your name.")
	                form203.processedby.focus()
	                return false
	           } 
		
			return true
				
		}
 
	function PutAddValues(form203){
		if (form203.same_address){
			form203.seller_street.value = form203.property_street.value
			form203.seller_city.value = form203.property_city.value
			form203.seller_state.value = form203.property_state.value
			form203.seller_zip.value = form203.property_zip.value
		    }
		return true;
	
		}	
		
	function getFSBOinfo(form203){
		if ((form203.list_type.value == '4') || ((form203.list_type.value == '4') && (form203.same_address))){
			if (form203.seller_comp.value == ''){
				form203.OB_compname.value = '--'
				}
			else{
				form203.OB_compname.value = form203.seller_comp.value 
			    }
				
			if (form203.seller_firstname1.value == ''){
				form203.OB_firstname.value = '--'
				form203.OB_lastname.value = '--'
				}
			else{
				form203.OB_firstname.value = form203.seller_firstname1.value
				form203.OB_lastname.value = form203.seller_lastname1.value
			    }
		    
			form203.OB_street.value = form203.seller_street.value
			form203.OB_state.value = form203.seller_state.value
			form203.OB_city.value = form203.seller_city.value
			form203.OB_zip.value = form203.seller_zip.value
			alert("Because it is a FSBO the O/B information is populated")
		  }
		  return true;
	
		}
			
		
	function getLastName(form203){
		if(form203.Seller_Salutation.value == "Mr. & Mrs."){
			form203.seller_lastname2.value = form203.seller_lastname1.value
			}
		
		return true;
		}
	
	function getLastNameBuyer(form203){
		if(form203.Buyer_Salutation.value == "Mr. & Mrs."){
			form203.buyer_lastname2.value = form203.buyer_lastname1.value
			}
		return true;
		}
	
</script> 
 
<cfinclude template="header.cfm">
<!--- <cfoutput>#firstname_value# - #lastname_value#</cfoutput> --->
<table width=95% align="center">
	<tr><td><H2>Form 203</h2></td></tr>
	<tr><td align="right"><font size=1, color="red">Fields marked with * are required fields</font></td></tr>
	<tr><td align="right"><font size=1, color="red">** indicates either/or required fields</font></td></tr>
</table>
<Form Action="form_203_action.cfm" Method="post" name="form203" onKeyPress="if(window.event.keyCode == 13) {return false}">
<table width=95% cellpadding="1" cellspacing="1" border=1 bordercolor="black" align="center">
	<tr>
		<td>		
			<table border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr>
				<td>
					<table width="100%">
					<tr>
						<td>Listing File No: <INPUT TYPE="text" Name="list_file_num" size="8" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;  </td>
						<td>MLS No.: <cfoutput><INPUT TYPE="text" Name="mls_num" size="8" value="#mls_value#" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"></cfoutput> &nbsp;&nbsp;  </td>
						<td><b>*Expected Closing Date:</b><INPUT TYPE="text" Name="exp_closeDate" size="8" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"> </td>
					</tr>
					<tr>
						<td>Listing Type: &nbsp;&nbsp;&nbsp;<b><cfoutput><cfif #form.list_type# IS 1>REO List O/B Sale
							<cfelseif #form.list_type# IS 2>REO List and Sale
							<cfelseif #form.list_type# IS 3>O/B List REO Sale
							<cfelse>For Sale By Owner</cfif> </cfoutput></b>
						</td>
						<td>Company ID:  <b><cfoutput>#session.CID#</cfoutput></b></td>
						<td>Office ID:  <b><cfoutput>#session.OID# </cfoutput> <cfif session.OID EQ '41'>(Commercial)</cfif></b></td>
					</tr>	
					</table>
				</td>
			</tr>			
			</table>
		</td>
	</tr>		
	<!--- Property information section --->
	
	<tr bgcolor="C0C0C0"><td><b>  Property Information </b></td></tr>
	<tr>
		<td>
			<table cellpadding="0" cellspacing="0" width="100%">
				<!--- First Row in the Property Info section (begins with address)  --->
				<tr>
					<td>
					<table>
						<cfoutput>
						<tr>
							<td><b>*Street Address:</b><INPUT TYPE="text" Name="property_street" size="22" value="#address_value#" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"> </td>
							<td> Unit No.:<INPUT TYPE="text" Name="property_unit" size="2" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp; </td>
							<td><b>*City:</b><INPUT TYPE="text" Name="property_city" size="6" value="#city_value#" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;  </td>
							<td><b>*State:</b><INPUT TYPE="text" Name="property_state" size="1" value="MI" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;  </td>
							<td><b>*ZipCode:</b><INPUT TYPE="text" Name="property_zip" size="3" value="#zip_value#" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"></td>
						</tr>
						</cfoutput>
					</table>
					</td>
				</tr>
				
				<tr>
					<td>
						<table>
						<cfoutput>
						<tr>
							<td>List Date:<INPUT TYPE="text" Name="property_LDate" size="6" value="#DateFormat(list_date_value, 'mm/dd/yy')#" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp; </td>
							<td><b>*Accept Date:</b><INPUT TYPE="text" Name="property_ADate" size="6" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp; </td>
							<td>List Price: $<INPUT TYPE="text" Name="property_LPrice" size="6" value="#list_price_value#" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'" onKeyPress="return checkIt(event)">&nbsp;&nbsp; </td>
							<td><b>*Sold Price:</b> $<INPUT TYPE="text" Name="property_SPrice" size="6" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'" onKeyPress="return checkIt(event)"> </td>
						</tr>
						</cfoutput>
						</table>
					</td>
				</tr>
				</table>
		</td>
	</tr>
	
		<!--- Lease information section --->
	
	<tr bgcolor="C0C0C0"><td><b> Lease Information </b></td></tr>
	<tr>
		<td>
			<table cellpadding="0" cellspacing="0" width="100%">
				<!--- First Row in the LeaseInfo section (begins with original lease date)  --->
				<tr>
					<td width="46%">
					<table>
						<cfoutput>
						<tr>
							<td width="140"><b>Original Lease Date:</b><INPUT TYPE="text" Name="original_leasedate" size="8" value ="#DateFormat (list_date_value, 'mm/dd/yy')#" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"> </td>
							<td>Lease Expiration Date:<INPUT TYPE="text" Name="exp_leasedate" size="8" value ="#DateFormat (list_date_value, 'mm/dd/yy')#" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"> </td>
							<td width="213">Monthly Lease Payment:  $<INPUT TYPE="text" Name="lease_pmt" size="6" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"> </td></tr>
							<tr><td>Option to extend: Y or N &nbsp; <INPUT TYPE="text" Name="option_extend" size="1"  class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">  </td>
							<td>Option to purchase: Y or N &nbsp; <INPUT TYPE="text" Name="option_purchase" size="1"  class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"></td>
							<td>Option Price:  $ : <input type="text" name="option_price" size="6" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'" /></td></tr>
						    <td>Tenant's Email Address:  <input type="text" name="tenant_email" size="12" class="TextBox" onFocus="this.className='TextBoxSelected';select()" onBlur="this.className='TextBox'"></td>
						    <td>Tenant's Phone Number:  <input type="text" name="tenant_phone" size="12" class="TextBox" onFocus="this.className='TextBoxSelected';select()" onBlur="this.className='TextBox'"></td>
						</tr>
						</cfoutput>
					</table>
					</td>
				
				
				
	<!--- Seller's information section --->	
	<tr bgcolor="C0C0C0"><td><b> Seller's Information</b> </td></tr>
	<tr> 
		<td>
			<table cellpadding="0" cellspacing="0" width="100%">
				<!--- First Row in the Seller's Section  --->
                
				<tr>
                <cfoutput>
					<td colspan=4><b>**Seller Company:</b><INPUT TYPE="text" Name="seller_comp" size="35" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;&nbsp;<b>OR</b></td>
				</tr>
				<tr>
					<td><select Name="Seller_Salutation">
							<option value="">--
							<option value="Mr.">Mr. 
							<option value="Mrs.">Mrs.
							<option value="Mr. & Mrs.">Mr.& Mrs.
			 				<option value="Ms.">Ms.
							
						</select>
					</td>
				
					<td align="left"><b>**First Name:</b><INPUT TYPE="text" Name="seller_firstname1" size="10" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;</td>
					<td align="left"><b>**Last Name:</b><INPUT TYPE="text" Name="seller_lastname1" size="10" onchange ="javascript:getLastName(form203);" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"> </td>
<!--- 					<td align="center">Soc.Sec. No:<INPUT TYPE="text" Name="seller_SSN1" size="15" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"> </td> --->
				</tr>
				<!--- Sellers Name if Mr and Mrs.--->
				<tr>
					<td>&nbsp;</td>
					<td>&nbsp;&nbsp;&nbsp;First Name:<INPUT TYPE="text" Name="seller_firstname2" size="10" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;</td>
					<td>&nbsp;&nbsp;&nbsp;Last Name:<INPUT TYPE="text" Name="seller_lastname2" size="10" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">  </td>
<!--- 					<td align="center"> Soc.Sec. No:<INPUT TYPE="text" Name="seller_SSN2" size="15" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"> </td> --->
				</tr>
				<!--- Street Address Row  --->
				<tr>
					<td valign="top" colspan="3" >
						<table align="left" cellpadding="0" cellspacing="0">
							<tr>
								<td>Address same as above:<INPUT TYPE="checkbox" Name="same_address" value=1  onClick="javascript:PutAddValues(form203);getFSBOinfo(form203);" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;&nbsp;&nbsp; </td>
							</tr>
							<tr>
								<td>&nbsp;<b>*Street Address:</b><INPUT TYPE="text" Name="seller_street" size="25" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;&nbsp;&nbsp; </td>
							</tr>
                            </cfoutput>
						</table>	
                        				
					</td>
					<td width="39%" align="right" rowspan="4">
						<table align="left" cellpadding="0" cellspacing="0" border="1" >
						<!--- Gross Commissions Row --->
						<tr >
							<td><cfoutput><cfif #form.list_type# IS 1 OR #form.list_type# IS 2><b>*</b></cfif></cfoutput>Gross Comm </td>
							<td><input type="Text" name="gr_comm_percentage" size="1" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">% </td>
							<td>$<input type="text" name="gr_comm_dollars" size="8" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"> </td>
						</tr>
						<tr>
							<cfoutput>
							<cfif #form.list_type# IS 2>
							<td><b>*</b>REO List  </td><!---Comp. Dollar--->
							<td><input type="Text" name="REO_list_percentage" size="1" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">% </td>
							<td>$<input type="text" name="REO_list_dollars" size="8"  class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"> </td>
							<cfelseif #form.list_type# IS 1 ><td><b>*</b>Amt Pd to O/B</td>
							<td><input type="Text" name="OB_percentage" size="1" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">% </td>
							<td>$<input type="text" name="OB_dollars" size="8" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'" > </td>
							<cfelse><td>Amt Pd to O/B</td>
							<td><input type="Text" name="OB_percentage" size="1" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">% </td>
							<td>$<input type="text" name="OB_dollars" size="8"  class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"> </td>
							</cfif>
							</cfoutput>
						</tr>
						<tr>
							<cfoutput>
							<cfif #form.list_type# IS 2>
							<td><b>*</b>REO Sale  </td><!---Comp. Dollar--->
							<td><input type="Text" name="REO_sale_percentage" size="1" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">% </td>
							<td>$<input type="text" name="REO_sale_dollars" size="8" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'" > </td>
							<cfelse><td><b>*</b>REO Gross</td>
							<td><input type="Text" name="comp_percentage" size="1" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">% </td>
							<td>$<input type="text" name="comp_dollars" size="8"  class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"> </td>
							</cfif>
							</cfoutput>
						</tr>														
						<tr>
							<td>Listing Ref </td>
							<td><input type="Text" name="list_percentage" size="1" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">% </td>
							<td>$<input type="text" name="list_dollars" size="8" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"> </td>
						</tr>			
						<tr>
							<td>Selling Ref</td>
							<td><input type="Text" name="sell_percentage" size="1" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">% </td>
							<td>$<input type="text" name="sell_dollars" size="8" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"> </td>
						</tr>			
																												
						</table>
					</td>
				</tr>
				<!--- City, State Row  --->
				<tr>
					<td valign="top" colspan="3">
						<table>
							<tr>
								<td><b>*City:</b><INPUT TYPE="text" Name="seller_city" size="6" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;</td>
								<td><b>*State:</b><INPUT TYPE="text" Name="seller_state" size="1" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;</td>
								<td><b>*ZipCode:</b><INPUT TYPE="text" Name="seller_zip" size="4"  class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'" onchange="javascript:getFSBOinfo(form203);">&nbsp;&nbsp;</td>
							</tr>
						</table>
					</td>
				</tr>
				<!--- Phone, Email Row  --->
				<tr>
					<td valign="top" colspan="3">
						<table>
							<tr>
								<td>Home/Cell Phone:<INPUT TYPE="text" Name="seller_homephone" size="10" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;&nbsp; </td>
								<td>WorkPhone:<INPUT TYPE="text" Name="seller_workphone" size="10" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;&nbsp; </td>
							</tr>
						</table>
					</td>	
				</tr>	
				<tr>
					<td valign="top" colspan="4">
						<table>
							<tr>
								<td>Email:<INPUT TYPE="text" Name="seller_email" size="12" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;&nbsp;&nbsp;  </td>
								<td>Emp/Sales Ass.<INPUT TYPE="checkbox" name="seller_emp_sales" value="1" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;&nbsp;&nbsp; </td>
								<!--- <td>Home-Link:<select Name="contact_seller">
											<option value="Yes">Yes
											<option value="No">No
											</select>
								</td> --->
							</tr>
						</table>
					</td>
				</tr>		
			</table>
		</td>
	</tr>
	
	<!---    Other Information  --->
	
	<tr bgcolor="C0C0C0"><td><b>  Other Information </b></td></tr>
	<tr>
		<td>
			<table cellpadding="0" cellspacing="0" width="100%">
				<tr>
					<td>
						<table>
						<tr>
						
							<tr>
							<td>  Seller's Source:</td>
							<td>  <select Name="Seller_Source">
									<option>UNKNOWN
									<option>Internet
									<option>Floor Call/Walk IN
									<option>Referral: Past Customer
									<option>Referral: Relocation/Corporate Services
									<option>Referral: Friend/Neighbor/Relative
									<option>Referral: From REO Sales Associate
									<option>Past Customer
									<option>Relist/Extension
									<option>OpenHouse
									<option>Other Broker Expired
									<option>For Sale By Owner(FSBO)
									<option>Cold Calls
									<option>Call Nights
									<option>Social Farming: Sphere of Influence
									<option>Geographic Farming
									<option>Company Paid Ad
									<option>Personal Ad: Newspaper/Photo Guide
									<option>Personalized Sign: For Sale/Open House
									<option>Direct Mail-postcards, newsletter etc.
									<option>Other
								</select> &nbsp;&nbsp;&nbsp;&nbsp;
							</td>
							<td>  Buyer's Source:</td>
							<td>  <select Name="Buyer_Source">
									<option>UNKNOWN
									<option>Internet
									<option>Floor Call/Walk IN
									<option>Referral: Past Customer
									<option>Referral: Relocation/Corporate Services
									<option>Referral: Friend/Neighbor/Relative
									<option>Referral: From REO Sales Associate
									<option>Past Customer
									<option>Relist/Extension
									<option>OpenHouse
									<option>Other Broker Expired
									<option>For Sale By Owner(FSBO)
									<option>Cold Calls
									<option>Call Nights
									<option>Social Farming: Sphere of Influence
									<option>Geographic Farming
									<option>Company Paid Ad
									<option>Personal Ad: Newspaper/Photo Guide
									<option>Personalized Sign: For Sale/Open House
									<option>Direct Mail-postcards, newsletter etc.
									<option>Other
								</select> &nbsp;&nbsp;&nbsp;&nbsp;
							</td>
						
							<!--- <td>  Source Of Listing/Sale:</td>
							<td>  <select Name="seller_Source">
									<option>UNKNOWN
									<option>01- Floor Call/Walk IN
									<option>02-Referral: Past Customer
									<option>03-Referral: Relocation/Corporate Services
									<option>04-Referral: Friend/Neighbor/Relative
									<option>05-Referral: From REO Sales Associate
									<option>06-Past Customer
									<option>07-Relist/Extension
									<option>08-OpenHouse
									<option>09-Other Broker Expired
									<option>10-For Sale By Owner(FSBO)
									<option>11-Cold Calls
									<option>12-Call Nights
									<option>13-Social Farming: Sphere of Influence
									<option>14-Geographic Farming
									<option>15-Company Paid Ad
									<option>16-Personal Ad: Newspaper/Photo Guide
									<option>17-Personalized Sign: For Sale/Open House
									<option>18-Direct Mail-postcards, newsletter etc.
									<option>19-Other
								</select> &nbsp;&nbsp;&nbsp;&nbsp;
							</td> --->
							<!---<td>Virtual Tour<input type="Checkbox" name="virtual_tour" value = 1>&nbsp;&nbsp;&nbsp;&nbsp; </td>--->
							<!--- <td>Home Warranty<input type="Checkbox" name="home_warranty" value = 1 class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp; </td>
							<td>Past Title<input type="Checkbox" name="past_title" value = 1 class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"> </td> --->
						</tr>	
						</table>
					</td>	
				</tr>
				<tr>
					<td >
						<table>
						<tr>
							<td>Home Warranty<input type="Checkbox" name="home_warranty" value = 1 class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp; </td>
							<td>Past Title<input type="Checkbox" name="past_title" value = 1 class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"> &nbsp;&nbsp;&nbsp;</td>
							<td>Order Continuity<input type="Checkbox" name="order_cont" value = 1  class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td>
							<td> Style:
							 	<select Name="Style">
									<option>None
									<option>Humorous Style
									<option>Traditional Style
									
								</select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							</td>
							
						</tr>	
						</table>
					</td>
				</tr>
				<tr>
					<td>
						<table>
						<td >Financing:
								 <select Name="financing">
									<option>Mortgage
									<option>Cash
									<option>Land Contract
								</select>&nbsp;&nbsp;&nbsp;&nbsp;
							</td>
						<tr>
							<td >If Mortgage, Mortgage Co.<input type="text" name="mortgage_co" size=12 class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"></td>
							<td>Rep.Name:<input type="text" name="mortgage_rep" size=12 class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"></td>
							<td>Phone:<input type="text" name="mortgage_phone" size=10 class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"></td>
							<td>Fax:<input type="text" name="mortgage_fax" size=10 class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"></td>
						</tr>	
						</table>
					</td>
				</tr>
			</table>
		</td>	
	</tr>
	
	<!--- Buyer's Information begins --->
	
	<tr bgcolor="C0C0C0"><td><b>  Buyer's Information </b></td></tr>
	<tr>
		<td>
			<table cellpadding="0" cellspacing="0" width="100%">
				<!--- First Row in the Buyer's Section (begins with name)  --->
				<tr>
					<td>
						<table>
							<tr>
								<td colspan=3><b>**Buyer Company:</b><INPUT TYPE="text" Name="buyer_comp" size="35" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;<b>OR</b></td>
							</tr>
							<tr>
								<td><select Name="Buyer_Salutation">
										<option value="">--
										<option value="Mr.">Mr. 
										<option value="Mrs.">Mrs.
										<option value="Mr. & Mrs.">Mr.& Mrs.
										<option value="Ms.">Ms.
										
									</select>
								</td>
								<td valign="top"><b>**First Name:</b><INPUT TYPE="text" Name="buyer_firstname1" size="12" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;&nbsp;&nbsp; </td>
								<td valign="top"><b>**Last Name:</b><INPUT TYPE="text" Name="buyer_lastname1" size="12" onchange ="javascript:getLastNameBuyer(form203);" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"> </td>
<!--- 								<td>Soc. Sec. No:<INPUT TYPE="text" Name="buyer_SSN1" size="15" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"> </td> --->
							</tr>
							<tr>
								<td>&nbsp;</td>
								<td valign="top">&nbsp;&nbsp;&nbsp;First Name:<INPUT TYPE="text" Name="buyer_firstname2" size="12" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;&nbsp;&nbsp; </td>
								<td  valign="top">&nbsp;&nbsp;&nbsp;Last Name:<INPUT TYPE="text" Name="buyer_lastname2" size="12" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;&nbsp;&nbsp;  </td>
<!--- 								<td valign="top">Soc. Sec. No:<INPUT TYPE="text" Name="buyer_SSN2" size="15" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;&nbsp;&nbsp; </td> --->
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td valign="top" colspan="3">
						<table>
							<tr>
								<td><b>*Street Address:</b><INPUT TYPE="text" Name="buyer_street" size="20" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp; </td>
								<td>Unit No.:<INPUT TYPE="text" Name="buyer_unit" size="6" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;&nbsp;&nbsp;   </td>
								<td>Emp/Sales Ass.<INPUT TYPE="checkbox" name="buyer_emp_sales" value="1" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"></td>
							</tr>
						</table>
					</td>
				</tr>
				<!--- City, State Row  --->
				<tr>
					<td valign="top" colspan="3">
						<table>
							<tr>
								<td><b>*City:</b><INPUT TYPE="text" Name="buyer_city" size="8" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;&nbsp;&nbsp; </td>
								<td><b>*State:</b><INPUT TYPE="text" Name="buyer_state" size="5" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;&nbsp;&nbsp; </td>
								<td><b>*ZipCode:</b><INPUT TYPE="text" Name="buyer_zip" size="8" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;&nbsp;&nbsp; </td>
								<td><b>*Contact Email:</b><INPUT TYPE="text" Name="buyer_email" size="10" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"> </td>
							</tr>
						</table>
					</td>
				</tr>
				<!--- Phone,  --->
				<tr>
					<td valign="top" colspan="3">
						<table>
							<tr>
								<td colspan="2"><b>*Home/Cell Phone:</b><INPUT TYPE="text" Name="buyer_homephone" size="15" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;&nbsp;&nbsp; </td>
								<td>Work Phone:<INPUT TYPE="text" Name="buyer_workphone" size="15" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;&nbsp;&nbsp; </td>
								<!--- <td>Home-Link:<select Name="contact_buyer">
											<option value="Yes">Yes
											<option value="No">No
											</select>
								</td> --->
							</tr>
						</table>
					</td>	
				</tr>	
			</table>
		</td>
	</tr>
	
	<!--- Listing Agent Information --->
	
	<!---REO List O/B Sale OR REO List and Sale--->
	<cfif (#form.list_type# IS 1) OR (#form.list_type# IS 2) >
	<tr bgcolor="C0C0C0"><td><b>  Listing Agent - REO Information </b></td></tr>
	<tr>
		<td>
			<table cellpadding="0" cellspacing="0" width="100%">
				<cfset number_listing_agents = #form.list_agents#>
				<cfset number = 1>
				<cfloop from="1" to="#number_listing_agents#" index="number">
				<!--- First Row in the REOAgent Section (begins with Office #)  --->
				<tr>
					<td >
						<cfoutput>
						<table width="100%" ><!--- <cfif number EQ 1>value="#payno_value#"</cfif><cfif #number# EQ 1>value="#office_id_value#" </cfif> --->
							<tr>
								<td>#number#.</td>
								<td><b>*Pay No:</b><INPUT TYPE="text" Name="LREO#number#_Paynum" size="1" onChange="javascript:AgentInfo(form203)"  class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"> </td>
								<td><b>*Office No.</b>:<INPUT TYPE="text" Name="LREO#number#_Officenum" size="1"    class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"></td>
								<td><b>*First Name:</b><INPUT TYPE="text" Name="LREO#number#_firstname" size="8" <cfif number EQ 1>value="#firstname_value#"</cfif> class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"> </td>
								<td><b>*Last Name:</b><INPUT TYPE="text" Name="LREO#number#_lastname" size="8" <cfif number EQ 1>value="#lastname_value#"</cfif> class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"> </td>
								<td><b>*Assoc port:</b><INPUT TYPE="text" Name="LREO#number#_assoport" size="2" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'" >$ OR % </td>
							</tr>
						</table>
						</cfoutput>
					</td>
				</tr>	
				<!--- </cfif> --->
			
				</cfloop>
			
				<!--- Port. Information for REO1 --->		
				<tr>
					<td colspan="3">
						<table>
							<tr>
<!--- 								<td valign="top">Gr. Comm. Port.:<INPUT TYPE="text" Name="LREO_grcommport" size="6" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;&nbsp; </td> --->
								<td valign="top">Ref. Port.:<INPUT TYPE="text" Name="LREO_refport" size="6" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;&nbsp; </td>
								<td valign="top">Corp. Ref.:<INPUT TYPE="checkbox" Name="LREO_corpref" value=1 class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;&nbsp;  </td>
<!--- 								<td valign="top">Contact Client:<INPUT TYPE="checkbox" Name="LREO_concl" value=1 class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"> </td> --->
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>	
	<!--- O/B list and REO sale--->
	<cfelse>
	<tr bgcolor="C0C0C0"><td><b>  Listing Agent - O/B Information </b></td></tr>
	<tr>
		<td>
			<table cellpadding="0" cellspacing="0" width="100%">
				<!--- First Row in the O/B Section (begins with name)  --->
				<tr>
					<td>
						<table><cfoutput>
							<tr>
								<td><b>*Comp. Name:</b><INPUT TYPE="text" Name="OB_compname" size="35" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'" value=" "> </td><!---#OB_compname_value# --->
								<td><b>*First Name:</b><INPUT TYPE="text" Name="OB_firstname" size="8" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'" value=""></td><!---#OB_firstname_value#  --->
								<td><b>*Last Name:</b><INPUT TYPE="text" Name="OB_lastname" size="8" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'" value=""></td><!---#OB_lastname_value#  --->
								<td>O/B No.:<INPUT TYPE="text" Name="OB_num" size="6" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"></td> 
							</tr></cfoutput>
						</table>
					</td>
				</tr>	
				<!--- Address row for O/B --->		
				<tr>
					<td>
						<table>
							<tr>
								<td>*Street:<INPUT TYPE="text" Name="OB_street" size="12" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp; </td>
								<td>Suite/Unit:<INPUT TYPE="text" Name="OB_suite" size="2" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp; </td>
								<td>*City:<INPUT TYPE="text" Name="OB_city" size="6" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp; </td>
								<td>*State:<INPUT TYPE="text" Name="OB_state" size="3" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;&nbsp;&nbsp; </td>
								<td>ZipCode:<INPUT TYPE="text" Name="OB_zip" size="5" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;&nbsp;&nbsp; </td>
							</tr>
						</table>
					</td>
				</tr>
				<!--- contact info for O/B --->
				<tr>
					<td>
						<table>
							<tr>
								<td>Email:<INPUT TYPE="text" Name="OB_email" size="10" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp; </td>
								<td>Phone:<INPUT TYPE="text" Name="OB_phone" size="10" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp; </td>
								<td>Fax:<INPUT TYPE="text" Name="OB_fax" size="10" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp; </td>
								<td>Contact:<INPUT TYPE="text" Name="OB_contact" size="12" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"> </td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>	
	</cfif>
	<!--- Listing Referral Information--->
	<tr bgcolor="C0C0C0"><td><b>  Listing Referral Information </b></td></tr>
	<tr>
		<td>
			<table cellpadding="0" cellspacing="0" width="100%">
				<tr>
					<td>
						<table>
							<tr>
								<td>Name:<INPUT TYPE="text" Name="LRef_name" size="15" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;</td>
								<td>Street:<INPUT TYPE="text" Name="LRef_street" size="25" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;</td>
								<td>Comp. Name:<INPUT TYPE="text" Name="LRef_compname" size="20" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"> </td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td>
						<table>
								<td>City:<INPUT TYPE="text" Name="LRef_city" size="8" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;</td>
								<td>State:<INPUT TYPE="text" Name="LRef_state" size="3" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;</td>
								<td>Zip:<INPUT TYPE="text" Name="LRef_zip" size="6" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;</td>
								<td>Phone:<INPUT TYPE="text" Name="LRef_num" size="8" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;</td>
								</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>	
	
	<!--- Selling Agent Information --->
	
	<!--- REO List and Sale  OR  O/B List REO Sale--->
	<cfif (#form.list_type# IS 2) OR (#form.list_type# IS 3) OR (#form.list_type# IS 4) >
	<tr bgcolor="C0C0C0"><td><b>  Selling Agent - REO Information </b></td></tr>
	<tr>
		<td>
			<table cellpadding="0" cellspacing="0" width="100%">
				<cfset number_selling_agents = #form.sell_agents#>
				<cfset number = 1>
				<cfloop from="1" to="#number_selling_agents#" index="number">
				<!--- First Row in the REOAgent Section (begins with Office #)  --->
				<tr>
					<td>
						<cfoutput>
						<table width=100%>
							<tr>
								<td>#number#.</td>
								<td><b>*Pay No.:</b><INPUT TYPE="text" Name="SREO#number#_Paynum" size="1" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"></td>
								<td><b>*Office No.:</b><INPUT TYPE="text" Name="SREO#number#_Officenum" size="1" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"></td>
								<td><b>*First Name:</b><INPUT TYPE="text" Name="SREO#number#_firstname" size="6" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"></td>
								<td><b>*Last Name:</b><INPUT TYPE="text" Name="SREO#number#_lastname" size="6" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"> </td>
								<td><b>*Assoc. port.:</b><INPUT TYPE="text" Name="SREO#number#_assoport" size="2" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">$ OR % </td>
							</tr>
						</table>
						</cfoutput>
					</td>
				</tr>	
				</cfloop>
			
				<!--- Port. Information for REO1 --->		
				<tr>
					<td>
						<table>
							<tr>
<!--- 								<td valign="top">Gr. Comm. Port.:<INPUT TYPE="text" Name="SREO_grcommport" size="6" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;&nbsp; </td> --->
								<td valign="top">Ref. Port.:<INPUT TYPE="text" Name="SREO_refport" size="6" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;&nbsp; </td>
								<td valign="top">Corp. Ref.:<INPUT TYPE="checkbox" Name="SREO_corpref" value=1 class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;&nbsp;  </td>
<!--- 								<td valign="top">Contact Client:<INPUT TYPE="checkbox" Name="SREO_concl" value=1 class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"> </td> --->
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>	
	<cfelse>
	<tr bgcolor="C0C0C0"><td><b>  Selling Agent - O/B Information </b></td></tr>
	<tr>
		<td>
			<table cellpadding="0" cellspacing="0" width="100%">
				<!--- First Row in the O/B Section (begins with name)  --->
				<tr>
					<td>
						<table>
							<tr>
								<td><b>*Comp. Name:</b><INPUT TYPE="text" Name="OB_compname" size="20" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"> </td>
								<td><b>*First Name:</b><INPUT TYPE="text" Name="OB_firstname" size="10" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"></td>
								<td><b>*Last Name:</b><INPUT TYPE="text" Name="OB_lastname" size="10" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"></td>
								 <td>O/B No.:<INPUT TYPE="text" Name="OB_num" size="6" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"></td> 
							</tr>
						</table>
					</td>
				</tr>	
				<!--- Address row for O/B --->		
				<tr>
					<td>
						<table>
							<tr>
								<td>*Street:<INPUT TYPE="text" Name="OB_street" size="20" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp; </td>
								<td>Suite/Unit:<INPUT TYPE="text" Name="OB_suite" size="4" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp; </td>
								<td>*City:<INPUT TYPE="text" Name="OB_city" size="8" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp; </td>
								<td>*State:<INPUT TYPE="text" Name="OB_state" size="4" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;&nbsp;  </td>
								<td>*ZipCode:<INPUT TYPE="text" Name="OB_zip" size="6" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;&nbsp;  </td>
							</tr>
						</table>
					</td>
				</tr>
				<!--- contact info for O/B --->
				<tr>
					<td>
						<table>
							<tr>
								<td>Email:<INPUT TYPE="text" Name="OB_email" size="12" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp; </td>
								<td>Phone:<INPUT TYPE="text" Name="OB_phone" size="12" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp; </td>
								<td>Fax:<INPUT TYPE="text" Name="OB_fax" size="12" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp; </td>
								<td>Contact:<INPUT TYPE="text" Name="OB_contact" size="12" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"> </td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>	
	</cfif>
	<!--- Selling Referral Information--->
	<tr bgcolor="C0C0C0"><td><b>  Selling Referral Information </b></td></tr>
	<tr>
		<td>
			<table cellpadding="0" cellspacing="0" width="100%">
				<tr>
					<td>
						<table>
							<tr>
								<td>Name:<INPUT TYPE="text" Name="SRef_name" size="20" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;</td>
								<td>Street:<INPUT TYPE="text" Name="SRef_street" size="25" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;</td>
								<td>Comp. Name:<INPUT TYPE="text" Name="SRef_compname" size="20" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"> </td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td>
						<table>
							<tr>
								<td>City:<INPUT TYPE="text" Name="SRef_city" size="8" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;</td>
								<td>State:<INPUT TYPE="text" Name="SRef_state" size="4" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;</td>
								<td>Zip:<INPUT TYPE="text" Name="SRef_zip" size="6" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;</td>
								<td>Phone:<INPUT TYPE="text" Name="SRef_num" size="8" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'">&nbsp;&nbsp;</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>	
 
	<!--- Disclosure Statement --->
	
	<tr bgcolor="C0C0C0" ><td align="center"><b>  Disclosure Statement Certification </b></td></tr>	
	<tr>
		<td>
			<table cellpadding="0" cellspacing="0" width="100%">
				<tr>&nbsp;</tr>
				<tr>
					<td align="center">  According to Company Policy, the following documents are on file with respect to the above referenced property. </td>
				</tr>
				<tr><td><hr></td></tr>
				
				<!--- Disclosure Information --->
				<tr>
					<td>
						<table width="450" border="0">
							<tr>
								<td >&nbsp;</td>
								<td align="center" colspan="2"><u>Other Broker's Side</u></td>
								<td>&nbsp;</td>
								<td align="center"colspan="2"><u>Real Estate One's Side</u></td>
							</tr>
		
							<tr>
								<td>&nbsp;</td>
								<td align="center" colspan="1">  Listing </td>
								<td colspan="1">  Sale </td>
								<td>&nbsp;</td>
								<td align="center" colspan="1">  Listing </td>
								<td colspan="1">  Sale </td>
							</tr>
							<tr>
								<td>  Agency Disclosure </td>
								<td align="center"><input type="checkbox" name="Agency_Broker_Listing" value=1 disabled></td>
								<td><input type="checkbox" name="Agency_Broker_Sale" value=1 disabled></td>
								<td>&nbsp;</td>
								<td align="center"><input type="checkbox" name="Agency_REO_Listing" value=1  class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"></td>
								<td><input type="checkbox" name="Agency_REO_Sale" value=1 class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"></td>
							</tr>
							
							<!--- added on 6/30/2008 --->
							<tr>
								<td>  RESPA Disclosure </td>
								<td align="center"><input type="checkbox" name="RESPA_Broker_Listing" value=1 disabled></td>
								<td><input type="checkbox" name="RESPA_Broker_Sale" value=1 disabled></td>
								<td>&nbsp;</td>
								<td align="center"><input type="checkbox" name="RESPA_REO_Listing" value=1  class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"></td>
								<td><input type="checkbox" name="RESPA_REO_Sale" value=1 class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"></td>
							</tr>
							
							<tr>
								<td>  Seller's Disclosure </td>
								<td align="center"><input type="checkbox" name="Seller_Broker_Listing" value=1 class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"></td>
								<td><input type="checkbox" name="Seller_Broker_Sale" value=1 class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"></td>
								<td>&nbsp;</td>
								<td align="center"><input type="checkbox" name="Seller_REO_Listing" value=1 class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"></td>
								<td><input type="checkbox" name="Seller_REO_Sale" value=1 class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"></td>
							</tr>
							<tr>
								<td>  Lead Paint Disclosure </td>
								<td align="center"><input type="checkbox" name="LeadPaint_Broker_Listing" value=1 class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"></td>
								<td><input type="checkbox" name="LeadPaint_Broker_Sale" value=1 class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"></td>
								<td>&nbsp;</td>
								<td align="center"><input type="checkbox" name="LeadPaint_REO_Listing" value=1  class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"></td>
								<td><input type="checkbox" name="LeadPaint_REO_Sale" value=1 class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"></td>
							</tr>
							<tr>
								<td>  Buyer Agency Contract </td>
								<td align="center"><input type="checkbox" name="Buyer_Broker_Listing" value=1 disabled></td>
								<td><input type="checkbox" name="Buyer_Broker_Sale" value=1 disabled></td>
								<td>&nbsp;</td>
								<td align="center"><input type="checkbox" name="Buyer_REO_Listing" value=1 disabled></td>
								<td><input type="checkbox" name="Buyer_REO_Sale" value=1 class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"></td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
			<tr bgcolor="C0C0C0"><td align="center"><b>	Comments/Special Instructions</b>
			</td></tr>
				<tr>
					<td>
						<table width="100%">
							<tr>
								<td><TextArea name="Comments" value="Comments" cols=65 rows=5 class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"></textarea></td>
							</tr>
						</table>
					</td>
				</tr>
				<!--- Signature and Date --->
				<tr>
					<td>
						<table width="100%">
							<tr>
								<td><b>*Processed By:</b>&nbsp;&nbsp;<input type="text" name="processedby" size="20" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"> </td>
								<td>Date Processed:&nbsp;&nbsp;<cfoutput><input type="text" name="date_processed" value="#DateFormat(Now(), 'mm/dd/yy')#" size="10" class="TextBox" onfocus="this.className='TextBoxSelected';select()" onblur="this.className='TextBox'"></cfoutput> </td>
							</tr>
						</table>
					</td>
				</tr>
				
			<tr>
				<td>
				<table width="100%">
				<tr>
					<td align="center"><input type="submit" name="Save_Close_Btn" value="Save and Close"  onClick="return formCheck(form203)" > </td>
					<td align="center"><input type="submit" name="Completed_Btn" value="Submit Completed/Updated Form" onClick="return formCheck2(form203)" > </td>
					<td  align="center"><input type="RESET" value="Clear Form"> </td>
					<cfoutput>
					<input type="HIDDEN" value="#form.list_type#" name="list_type">
					<input type="HIDDEN" value="#form.sell_agents#" name="sell_agents">
					<input type="HIDDEN" value="#form.list_agents#" name="list_agents">
					
					<!--- <input type="HIDDEN" value="#URL.UID#" name="UID">--->
					<input type="HIDDEN" value="#session.CID#" name="CID">
					<input type="HIDDEN" value="#session.OID#" name="OID"> 
	
					</cfoutput>
				</tr>
				</table>
			</td>
		</tr>
	
</table>
 
</form>
 
</body>
</html>

Open in new window

Avatar of gdemaria
gdemaria
Flag of United States of America image

Not sure if this will fix the problem, you're using # around a variable without quotes, so if the value of the variable is empty the CFIF will read   ...AND    NEQ '' > 

Also parameterExists only exists for backward compatibility, isDefined should be used.

So this...

<cfif parameterExists(form.mls_num) AND #form.mls_num# NEQ ''>


Should be this..   Note the added " quotes and removal of the # signs...

<cfif isDefined("form.mls_num") AND form.mls_num NEQ ''>

I don't see how that error could be coming from this page.  Unless you're using different code that what you posted.  

The error you posted is from a database query.  The code above has only one query and almost certainly it should not generate that type of error.  

      SELECT * FROM all_listings_new
      WHERE mls = '#form.mls_num#'


>  <cfquery name="GetRecordByMLS" datasource="#gDSN#" MAXROWS="1">
>      SELECT * FROM all_listings_new
>    ....

     BTW - Nothing to do with your error, but
     A)  It's better to list only columns you need rather than using SELECT *  
     B)  Most databases have operators that limit the results returned. It's better to use
     your db's operator instead of MAXROWS.  

     Example:   MS SQL  =>       SELECT TOP 1 CustomerName FROM Customers
     
     
Avatar of jdines

ASKER

Hello,
  Thanks for the feedback, I checked the form_203_action and could not find an error.  The former programmer set this up so it's really difficult for me to work through this (I am new to ColdFusion) so I have attached the code from that page and hopefully you can help me pinpoint the error.  Thanks so very much, this has been driving me crazy for over a week.
<!--- if session has expired --->
<cfif NOT ISDEFINED("session.pwd") >
	<cflocation url="../index.cfm">
	<cfabort>
</cfif> 
 
 
<cfif session.security_type IS 'agent'>
	<cfinclude template="header_agent.cfm">
<cfelse>  
	<cfinclude template="header.cfm">
 
</cfif><head>
<script language="JavaScript">
		function NewWindow(){
			var win = window.open(('ViewText.cfm?RecordID=#RecordID#', 'print',  'scrollbars=auto');
			win.focus();
		}
	</script>  
</head>
 
<cfif NOT parameterExists(form.Pending_Btn)><cfset form.Pending_Btn = ''></cfif>
<cfif NOT parameterExists(form.Save_Close_Btn)><cfset form.Save_Close_Btn = ''></cfif>
<cfif NOT parameterExists(form.Completed_Btn)><cfset form.Completed_Btn = ''></cfif>
<cfif NOT parameterExists(form.LREO_refport)><cfset form.LREO_refport = ''></cfif>
<cfif NOT parameterExists(form.Review_Complete)><cfset form.Review_Complete = ''></cfif>
<cfif NOT parameterExists(form.Process_btn)><cfset form.Process_btn = ''></cfif>
<cfif NOT parameterExists(form.Revised_btn)><cfset form.Revised_btn = ''></cfif>
<cfif NOT parameterExists(form.Deal_Off_btn)><cfset form.Deal_Off_btn = ''></cfif>
 
<cfset InputError = 'No'>
 
<!--- replace apostrophe and comma in the name with the blank --->
<cfif (form.list_type IS 1) OR (form.list_type IS 2) >
	<cfloop from="1" to="#form.list_agents#" index="number">
		 <cfset LREO_firstname = "#Evaluate("form.LREO#number#_firstname")#">
		 <cfset 'form.LREO#number#_firstname' = '#Replace(LREO_firstname, "'", " ", "All")#'> 
		 <!--- <cfset 'form.LREO#number#_firstname' = '#Replace(LREO_firstname, ",", " ", "All")#'>  --->
		  <cfset LREO_lastname = "#Evaluate("form.LREO#number#_lastname")#">
		 <cfset 'form.LREO#number#_lastname' = '#Replace(LREO_lastname, "'", " ", "All")#'> 
		  <!--- <cfset 'form.LREO#number#_lastname' = '#Replace(LREO_lastname, ",", " ", "All")#'>  --->
	</cfloop>
</cfif>
<cfif (form.list_type IS 2) OR (form.list_type IS 3) OR (form.list_type IS 4) >
	<cfloop from="1" to="#form.sell_agents#" index="number">
		 <cfset SREO_firstname = "#Evaluate("form.SREO#number#_firstname")#">
		 <cfset 'form.SREO#number#_firstname' = '#Replace(SREO_firstname, "'", " ", "All")#'> 
		 <cfset 'form.SREO#number#_firstname' = '#Replace(SREO_firstname, ",", " ", "All")#'> 
		  <cfset SREO_lastname = "#Evaluate("form.SREO#number#_lastname")#">
		 <cfset 'form.SREO#number#_lastname' = '#Replace(SREO_lastname, "'", " ", "All")#'> 
		 <cfset 'form.SREO#number#_lastname' = '#Replace(SREO_lastname, ",", " ", "All")#'> 
	</cfloop>
</cfif>
 
<!--- check dates --->
<!--- do not check for any validation if it is saved as Incomplete --->
 
 
<cfif (form.Save_Close_Btn NEQ "Save and Close")>
	<cfif (form.property_LDate) NEQ ''> 
		<cfif IsDate(form.property_LDate) EQ 'No'>
			<cfoutput> Invalid List Date entered! Use MM/DD/YY format when entering the date</cfoutput><br>
			<cfset InputError = 'Yes'>
		</cfif>
	</cfif>
	<cfif (form.property_ADate) NEQ '' AND IsDate(form.property_ADate) EQ 'No'>
		 <cfoutput>Invalid Accept Date entered! Use MM/DD/YY format when entering the date</cfoutput><br>
		<cfset InputError = 'Yes'>
	</cfif>
	<cfif (form.exp_closeDate) NEQ '' AND IsDate(form.exp_closeDate) EQ 'No'>
		 <cfoutput>Invalid Expected Closing Date entered! Use MM/DD/YY format when entering the date</cfoutput><br>
		<cfset InputError = 'Yes'>
	</cfif>
</cfif>
 
 
<!--- check for LREO and SREO info if 'Submitted' as Complete--->
 <cfif (FORM.Completed_Btn IS "Submit Completed/Updated Form")>
	<cfif (#form.list_type# IS 1) OR (#form.list_type# IS 2) >
		<cfset number_listing_agents = #form.list_agents#>
		<cfset number = 1>
		<cfloop from="1" to="#number_listing_agents#" index="number">
			<cfset LREO_Officenum = "#Evaluate("form.LREO#number#_Officenum")#">
			<cfset LREO_Paynum = "#Evaluate("form.LREO#number#_Paynum")#">
			<cfset LREO_firstname = "#Evaluate("form.LREO#number#_firstname")#"><br>
			<cfset LREO_lastname = "#Evaluate("form.LREO#number#_lastname")#">
			<cfset LREO_assoport = "#Evaluate("form.LREO#number#_assoport")#">
			<cfif (LREO_Officenum EQ '')  OR (LREO_Paynum EQ '') OR (LREO_firstname EQ '') OR (LREO_lastname EQ '') OR (LREO_assoport EQ '')> 
				<cfoutput><tr><td>Please fill out all the information for the listing agents.</td></tr></cfoutput>
				<cfset InputError = 'Yes'>
			</cfif>	
		</cfloop>
	</cfif>
	<cfif (#form.list_type# IS 2) OR (#form.list_type# IS 3) OR (#form.list_type# IS 4)>
		<cfset number_selling_agents = #form.sell_agents#>
		<cfset number = 1>
		<cfloop from="1" to="#number_selling_agents#" index="number">
			<cfset SREO_Officenum = "#Evaluate("form.SREO#number#_Officenum")#">
			<cfset SREO_Paynum = "#Evaluate("form.SREO#number#_Paynum")#">
			<cfset SREO_firstname = "#Evaluate("form.SREO#number#_firstname")#"><br>
			<cfset SREO_lastname = "#Evaluate("form.SREO#number#_lastname")#">
			<cfset SREO_assoport = "#Evaluate("form.SREO#number#_assoport")#">
			<cfif (SREO_Officenum EQ '')  OR (SREO_Paynum EQ '') OR (SREO_firstname EQ '') OR (SREO_lastname EQ '') OR (SREO_assoport EQ '')> 
				<cfoutput>Please fill out all the information for the selling agents.</cfoutput>
				<cfset InputError = 'Yes'>
			</cfif>
		</cfloop>
	</cfif>
	<cfif (#form.list_type# IS 1) OR (#form.list_type# IS 3) OR (#form.list_type# IS 4) >
		<cfif (OB_compname EQ '')  OR (OB_firstname EQ '') OR (OB_lastname EQ '')> 
			<cfoutput><tr><td>Please fill out all the information for the Other Broker (O/B).</td></tr></cfoutput>
			<cfset InputError = 'Yes'>
		</cfif>
	
	</cfif>
	
		<!--- check to see if submitted date is less than 5 days of the close date --->
	<cfif form.exp_closeDate NEQ ''>
	<cfset closeDate = '#DateFormat(form.exp_CloseDate, 'mm/dd/yy')#'>
	<cfset dateNow = '#DateFormat(form.date_processed, 'mm/dd/yy')#'>
		
		<cfif #closeDate# LTE #DateAdd('D', 5, dateNow)#>
			<tr><td><b>The submitted 203 is within 5 days of the expected closing date. This may affect the commissions check to be processed on time. <br></b></td></tr>
		</cfif>
		
 
	</cfif>
	
	
	<!--- set up the process_month based on accept_date and date_submitted --->
	<cfset date_submitted_value = #DateFormat(form.date_processed, 'mm/dd/yy')#>
		
		<!--- check submitted date for the process month --->
		<cfset month =  #dateFormat(date_submitted_value , 'mm')#>
		<cfset year = #dateFormat(date_submitted_value , 'YYYY')#>
		<cfset init_date = '#month#/1/#year#'>
		<cfset pre_mon = #DateAdd('M', -1, date_submitted_value)#>
			<cfset wday = 0>
			<cfset numdays=datediff("d", init_date, date_submitted_value)>
			<cfloop from="0" to="#numdays#" index="a">
			<!--- if the day is neither saturday or sunday add a week day. --->
				<cfif ((dayofweek(dateadd("d", a, init_date)) NEQ 1) AND (dayofweek(dateadd("d", a, init_date)) neq 7))>
					<cfset wday = wday + 1>
				</cfif>
		   	</cfloop>
			
		<!--- changed it to 2 days as per Meredith on 3/3/05---><!--- 3 --->
		<!--- if there is a holiday at the end of the month then increase a day --->
			<cfif #wday# GTE 2>
				<cfset pro_Mon = #DateFormat(date_submitted_value, 'MM')#>
				<cfset pro_Year =  #DatePart('YYYY', date_submitted_value)#> 
			<cfelse>
				<cfset pro_Mon = #DateFormat(#DateAdd('M', -1, date_submitted_value)#, 'MM')#>
				<cfset pro_Year = '2008'>
			</cfif> 
		
			
			<!--- <cfset pro_Year =  #DatePart('YYYY', date_submitted_value)#> --->
			<cfset process_Month = '#MonthAsString(pro_Mon)# #pro_Year#' >
		
		
		
		<!--- check the property_ADate for the process month --->
		
		
		
		<!--- need to comment this out as it failed in some instances, will need
		to check it for validation -- 8/2/2007 --->
		<!--- 
		 <cfif ((DateFormat(#form.property_ADate#, 'MM') GT #pro_Mon#) AND (dateFormat(#form.property_ADate#, 'YYYY') GTE #dateFormat(date_submitted_value, 'YYYY')#))
			OR  ((DateFormat(#form.property_ADate#, 'MM') LT #pro_Mon#) AND (dateFormat(#form.property_ADate#, 'YYYY') GT #dateFormat(date_submitted_value, 'YYYY')#))>		
<!--- 		<cfif (DateFormat(#form.property_ADate#, 'MM') GT #pro_Mon#) OR (dateFormat(#form.property_ADate#, 'YYYY') GT #dateFormat(date_submitted_value, 'YYYY')#)> --->
			<tr><td><p> You cannot submit this form this month, because the 'Accept Date' is for the next processing month!<br><br>
			Please go back and click on <b>'Save and Close'</b> to save as <b>'Incomplete'.</b>
			<br><br><center>
			<a href="javascript:history.go(-1)">Go Back</a></td></tr></center>
			<cfabort>
		</cfif> --->
		 
		 
		 
		<cfset status='Submitted'>
		<cfset Review_Flag_VALUE = "0">
		
						
</cfif> 
 
<cfif (FORM.Save_Close_Btn IS "Save and Close")  >
	<cfset status='Incomplete'>
	<cfset Review_Flag_VALUE = "0"> 
<cfelseif FORM.Pending_Btn IS "Save Incomplete">
	<cfset status='Pending'>
	<cfset Review_Flag_VALUE = "0"> 
<cfelseif FORM.Review_Complete IS "Review and Submit to Accounting">
	<cfset Review_Flag_VALUE = "1">
	<cfset status='Reviewed'>
<cfelseif FORM.Process_btn IS "Submit for Processing">
	<cfquery name="chkFlag" datasource="#gDSN#">
	SELECT Review_Flag	FROM tblForm203	
	WHERE  RecordID = #RecordID# 
	</cfquery>
	<cfif chkFlag.Review_Flag IS 1>
		<cfset Review_Flag_VALUE = "1">
	<cfelse>
		<cfset Review_Flag_VALUE = "0"> 
	</cfif>
	<cfset status='Processed'>
<cfelseif (FORM.Revised_btn IS "Revise Form") >
	<cfquery name="chkFlag" datasource="#gDSN#">
	SELECT Review_Flag	FROM tblForm203	
	WHERE  RecordID = #RecordID# 
	</cfquery>
	<cfoutput query="chkFlag">
		<cfif chkFlag.Review_Flag IS 1>
			<cfset status = "Revised">
			<cfset Review_Flag_VALUE = "1">
		<cfelse>
			 <cfset status = "Submitted">
			 <cfset Review_Flag_VALUE = "0">
		</cfif>
	</cfoutput>
<cfelseif FORM.Deal_Off_btn IS "Deal Off">
	<cfset status='Deal Off'>
	<cfset Review_Flag_VALUE = "0"> 
</cfif>
 
<!--- checkbox validation--->
<cfif NOT parameterExists(form.same_address)>
	<cfset form.same_address = 0>
<cfelse>
	<cfset form.seller_street = #form.property_street#>
	<cfset form.seller_city = #form.property_city#>
	<cfset form.seller_state = #form.property_state#>
	<cfset form.seller_zip = #form.property_zip#>
</cfif>
<cfif (NOT parameterExists(form.seller_emp_sales)) OR (form.seller_emp_sales EQ '')><cfset form.seller_emp_sales = 0><cfelse><cfset form.seller_emp_sales = '1'></cfif>
<cfif (NOT parameterExists(form.home_warranty)) OR (form.home_warranty EQ '')><cfset form.home_warranty = 0><cfelse><cfset form.home_warranty = '1'></cfif>
<cfif (NOT parameterExists(form.order_cont)) OR (form.order_cont EQ '')><cfset form.order_cont = 0><cfelse><cfset form.order_cont = '1'></cfif>
<cfif (NOT parameterExists(form.past_title)) OR (form.past_title EQ '')><cfset form.past_title = 0><cfelse><cfset form.past_title = '1'></cfif>
<cfif (NOT parameterExists(form.buyer_emp_sales)) OR (form.buyer_emp_sales EQ '')><cfset form.buyer_emp_sales = 0><cfelse><cfset form.buyer_emp_sales = '1'></cfif>
<cfif (NOT parameterExists(form.Agency_Broker_Listing)) OR (form.Agency_Broker_Listing EQ '')><cfset form.Agency_Broker_Listing = 0><cfelse><cfset form.Agency_Broker_Listing = '1'></cfif>
<cfif (NOT parameterExists(form.Agency_Broker_Sale)) OR (form.Agency_Broker_Sale EQ '')><cfset form.Agency_Broker_Sale = 0><cfelse><cfset form.Agency_Broker_Sale = '1'></cfif>
<cfif (NOT parameterExists(form.Agency_REO_Sale)) OR (form.Agency_REO_Sale EQ '')><cfset form.Agency_REO_Sale = 0><cfelse><cfset form.Agency_REO_Sale = '1'></cfif>
<cfif (NOT parameterExists(form.Agency_REO_Listing)) OR (form.Agency_REO_Listing EQ '')><cfset form.Agency_REO_Listing = 0><cfelse><cfset form.Agency_REO_Listing = '1'></cfif> 
 
<cfif (NOT parameterExists(form.RESPA_Broker_Listing)) OR (form.RESPA_Broker_Listing EQ '')><cfset form.RESPA_Broker_Listing = 0><cfelse><cfset form.RESPA_Broker_Listing = '1'></cfif>
<cfif (NOT parameterExists(form.RESPA_Broker_Sale)) OR (form.RESPA_Broker_Sale EQ '')><cfset form.RESPA_Broker_Sale = 0><cfelse><cfset form.RESPA_Broker_Sale = '1'></cfif>
<cfif (NOT parameterExists(form.RESPA_REO_Sale)) OR (form.RESPA_REO_Sale EQ '')><cfset form.RESPA_REO_Sale = 0><cfelse><cfset form.RESPA_REO_Sale = '1'></cfif>
<cfif (NOT parameterExists(form.RESPA_REO_Listing)) OR (form.RESPA_REO_Listing EQ '')><cfset form.RESPA_REO_Listing = 0><cfelse><cfset form.RESPA_REO_Listing = '1'></cfif> 
 
<cfif (NOT parameterExists(form.Seller_Broker_Listing)) OR (form.Seller_Broker_Listing EQ '')><cfset form.Seller_Broker_Listing = 0><cfelse><cfset form.Seller_Broker_Listing = '1'></cfif>
<cfif (NOT parameterExists(form.Seller_Broker_Sale)) OR (form.Seller_Broker_Sale EQ '')><cfset form.Seller_Broker_Sale = 0><cfelse><cfset form.Seller_Broker_Sale = '1'></cfif>
<cfif (NOT parameterExists(form.Seller_REO_Sale)) OR (form.Seller_REO_Sale EQ '')><cfset form.Seller_REO_Sale = 0><cfelse><cfset form.Seller_REO_Sale = '1'></cfif>
<cfif (NOT parameterExists(form.Seller_REO_Listing)) OR (form.Seller_REO_Listing EQ '')><cfset form.Seller_REO_Listing = 0><cfelse><cfset form.Seller_REO_Listing = '1'></cfif> 
<cfif (NOT parameterExists(form.LeadPaint_Broker_Listing)) OR (form.LeadPaint_Broker_Listing EQ '')><cfset form.LeadPaint_Broker_Listing = 0><cfelse><cfset form.LeadPaint_Broker_Listing = '1'></cfif>
<cfif (NOT parameterExists(form.LeadPaint_Broker_Sale)) OR (form.LeadPaint_Broker_Sale EQ '')><cfset form.LeadPaint_Broker_Sale = 0><cfelse><cfset form.LeadPaint_Broker_Sale = '1'></cfif>
<cfif (NOT parameterExists(form.LeadPaint_REO_Sale)) OR (form.LeadPaint_REO_Sale EQ '')><cfset form.LeadPaint_REO_Sale = 0><cfelse><cfset form.LeadPaint_REO_Sale = '1'></cfif>
<cfif (NOT parameterExists(form.LeadPaint_REO_Listing)) OR (form.LeadPaint_REO_Listing EQ '')><cfset form.LeadPaint_REO_Listing = 0><cfelse><cfset form.LeadPaint_REO_Listing = '1'></cfif> 
<cfif (NOT parameterExists(form.Buyer_Broker_Listing)) OR (form.Buyer_Broker_Listing EQ '')><cfset form.Buyer_Broker_Listing = 0><cfelse><cfset form.Buyer_Broker_Listing = '1'></cfif>
<cfif (NOT parameterExists(form.Buyer_Broker_Sale)) OR (form.Buyer_Broker_Sale EQ '')><cfset form.Buyer_Broker_Sale = 0><cfelse><cfset form.Buyer_Broker_Sale = '1'></cfif>
<cfif (NOT parameterExists(form.Buyer_REO_Sale)) OR (form.Buyer_REO_Sale EQ '') ><cfset form.Buyer_REO_Sale = 0><cfelse><cfset form.Buyer_REO_Sale = '1'></cfif>
<cfif (NOT parameterExists(form.Buyer_REO_Listing)) OR (form.Buyer_REO_Listing EQ '')><cfset form.Buyer_REO_Listing = 0><cfelse><cfset form.Buyer_REO_Listing = '1'></cfif> 
<cfif (NOT parameterExists(form.LREO_corpref)) OR (form.LREO_corpref EQ '')><cfset form.LREO_corpref = '0'><cfelse><cfset form.LREO_corpref = '1'></cfif>
<!--- <cfif (NOT parameterExists(form.LREO_concl)) OR (form.LREO_concl EQ '')><cfset form.LREO_concl = '0'><cfelse><cfset form.LREO_concl = '1'></cfif> --->
<cfif (NOT parameterExists(form.SREO_corpref)) OR (form.SREO_corpref EQ '')><cfset form.SREO_corpref = '0'><cfelse><cfset form.SREO_corpref = '1'></cfif>
<!--- <cfif (NOT parameterExists(form.SREO_concl)) OR (form.SREO_concl EQ '')><cfset form.SREO_concl = '0'><cfelse><cfset form.SREO_concl = '1'></cfif> --->
 
<cfif parameterExists(form.date_processed)><cfset form.date_processed = #DateFormat(form.date_processed, 'mm/dd/yy')#></cfif>
<cfif parameterExists(form.property_LDate)><cfset form.property_LDate = #DateFormat(form.property_LDate, 'mm/dd/yy')#></cfif>
<cfif parameterExists(form.property_ADate)><cfset form.property_ADate = #DateFormat(form.property_ADate, 'mm/dd/yy')#></cfif>
<cfif parameterExists(form.date_updated)><cfset form.date_updated = #DateFormat(form.date_updated, 'mm/dd/yy')#></cfif>
 
<cfif (form.property_LPrice EQ '')><cfset #form.property_LPrice# = '0'></cfif>
<cfif (form.property_SPrice EQ '')><cfset #form.property_SPrice# = '0'></cfif>
 
<cfif InputError EQ 'Yes'>
	<p> Input error, please go back and correct errors before resubmitting!<br>
	<br><center>
	<a href="javascript:history.go(-1)">Correct errors</a></center>
	<cfabort>
</cfif> 
 
<!--- To avoid resubmitting and creating duplicate records --->
<cfif NOT parameterExists(form.RecordID)>
	<cfquery name="chkData" datasource="#gDSN#">
	SELECT 	RecordID	FROM tblForm203
	WHERE	property_street = '#form.property_street#'
		AND	property_city = '#form.property_city#'	
		AND	property_zip = '#form.property_zip#'
		AND status <> 'Deal-off Closed'
		AND  status <> 'Deal Off'
		AND  status <> 'Closed'  
		<!--- AND date_submitted = #DateFormat(form.date_processed, 'mm/dd/yy')# --->
	</cfquery>
	
	<cfif chkData.RecordCount NEQ '0'>
		<tr><td><cfoutput>You cannot resubmit this record, please go to the <b>'View All'</b> or <b>Update 203</b> and Update to resubmit this record.</td></tr></cfoutput>
		<cfabort>
	</cfif>
</cfif> 
 
 
<cfif parameterExists(form.RecordID)>
	
	<cfquery name="UpdateRecord" datasource="#gDSN#">
	UPDATE	tblForm203 
	SET		list_file_num='#form.list_file_num#', mls_num='#form.mls_num#', exp_closeDate='#form.exp_closeDate#',
			seller_comp='#form.seller_comp#', seller_salutation='#form.seller_salutation#', seller_firstname1='#form.seller_firstname1#',
			seller_lastname1='#form.seller_lastname1#',  seller_firstname2='#form.seller_firstname2#', 
			seller_lastname2='#form.seller_lastname2#', seller_street='#form.seller_street#',
		 	seller_city='#form.seller_city#', seller_state='#form.seller_state#', seller_zip='#form.seller_zip#',
			seller_homephone='#form.seller_homephone#', seller_workphone='#form.seller_workphone#',
			seller_email='#form.seller_email#', seller_emp_sales='#form.seller_emp_sales#', 
			home_warranty='#form.home_warranty#', order_cont='#form.order_cont#', property_street='#form.property_street#', 
			property_unit='#form.property_unit#', property_city='#form.property_city#', property_state='#form.property_state#',
			property_zip='#form.property_zip#',	property_LDate='#form.property_LDate#', property_ADate='#form.property_ADate#',
			property_LPrice='#form.property_LPrice#', property_SPrice='#form.property_SPrice#',
original_leasedate='#form.original_leasedate#', exp_leasedate='#form.exp_leasedate#', lease_pmt='#form.lease_pmt#',option_extend='#form.option_extend#',
option_purchase='#form.option_purchase#',option_price='#form.option_price#',
tenant_email='#form.tenant_email#',tenant_phone='#form.tenant_phone#'                   seller_source='#form.seller_source#',  buyer_source='#form.buyer_source#',
			past_title='#form.past_title#', style='#form.style#', financing='#form.financing#',
			mortgage_co='#form.mortgage_co#', mortgage_rep='#form.mortgage_rep#', mortgage_phone='#form.mortgage_phone#',
			mortgage_fax='#form.mortgage_fax#',	buyer_comp='#form.buyer_comp#', buyer_salutation='#form.buyer_salutation#',
			buyer_firstname1='#form.buyer_firstname1#', buyer_lastname1='#form.buyer_lastname1#',
			buyer_firstname2='#form.buyer_firstname2#', buyer_lastname2='#form.buyer_lastname2#',
			buyer_street='#form.buyer_street#', buyer_unit='#form.buyer_unit#', buyer_emp_sales='#form.buyer_emp_sales#',
			buyer_city='#form.buyer_city#',	buyer_state='#form.buyer_state#', buyer_zip='#form.buyer_zip#',
			buyer_email='#form.buyer_email#', buyer_homephone='#form.buyer_homephone#', buyer_workphone='#form.buyer_workphone#',
			gr_comm_percentage='#form.gr_comm_percentage#', gr_comm_dollars='#form.gr_comm_dollars#',
			<cfif (form.list_type IS 2)>
			REO_list_percentage='#form.REO_list_percentage#', REO_list_dollars='#form.REO_list_dollars#',
			REO_sale_percentage='#form.REO_sale_percentage#', REO_sale_dollars='#form.REO_sale_dollars#',
			<cfelse>
			OB_percentage='#form.OB_percentage#', OB_dollars='#form.OB_dollars#', 
			comp_percentage='#form.comp_percentage#', comp_dollars='#form.comp_dollars#',
			</cfif>
			list_percentage='#form.list_percentage#',list_dollars='#form.list_dollars#', sell_percentage='#form.sell_percentage#', sell_dollars='#form.sell_dollars#', 
			 <!--- Loop Through Listing Agents --->
			 <cfif (form.list_type IS 1) >
				<cfset number_listing_agents = '#form.list_agents#'>
				<cfset Lnumber = 1>
				<cfloop from="1" to="#number_listing_agents#" index="Lnumber">
				LREO#Lnumber#_Officenum='#Evaluate("form.LREO#Lnumber#_Officenum")#', LREO#Lnumber#_Paynum='#Evaluate("form.LREO#Lnumber#_Paynum")#',
				LREO#Lnumber#_firstname= '#Evaluate("form.LREO#Lnumber#_firstname")#', LREO#Lnumber#_lastname='#Evaluate("form.LREO#Lnumber#_lastname")#', LREO#Lnumber#_assoport='#Evaluate("form.LREO#Lnumber#_assoport")#', 
				<cfset Lnumber = #Lnumber# + 1>				
				</cfloop>
				LREO_refport='#form.LREO_refport#', LREO_corpref='#form.LREO_corpref#',
				OB_firstname='#form.OB_firstname#', OB_lastname='#form.OB_lastname#', OB_compname='#form.OB_compname#',
				 OB_suite='#form.OB_suite#', OB_street='#form.OB_street#', OB_city='#form.OB_city#',
				OB_state='#form.OB_state#', OB_zip='#form.OB_zip#',	OB_phone='#form.OB_phone#', OB_fax='#form.OB_fax#',
				OB_email='#form.OB_email#', OB_contact='#form.OB_contact#',
			</cfif> 
			<!--- Loop Through Listing & Selling Agents --->
			 <cfif (form.list_type IS 2)>
			 	<cfset number = 1>
			 	<cfset number_listing_agents = '#form.list_agents#'>
				<cfloop from="1" to="#number_listing_agents#" index="number">
				LREO#number#_Officenum='#Evaluate("form.LREO#number#_Officenum")#', LREO#number#_Paynum='#Evaluate("form.LREO#number#_Paynum")#',
				LREO#number#_firstname= '#Evaluate("form.LREO#number#_firstname")#', LREO#number#_lastname='#Evaluate("form.LREO#number#_lastname")#', LREO#number#_assoport='#Evaluate("form.LREO#number#_assoport")#', 
				</cfloop>
				LREO_refport='#form.LREO_refport#', LREO_corpref='#form.LREO_corpref#', 
				<cfset number_selling_agents = '#form.sell_agents#'>
				<cfloop from="1" to="#number_selling_agents#" index="number">
				SREO#number#_Officenum='#Evaluate("form.SREO#number#_Officenum")#', SREO#number#_Paynum='#Evaluate("form.SREO#number#_Paynum")#',
				SREO#number#_firstname= '#Evaluate("form.SREO#number#_firstname")#', SREO#number#_lastname= '#Evaluate("form.SREO#number#_lastname")#', SREO#number#_assoport='#Evaluate("form.SREO#number#_assoport")#', 
				</cfloop>
				SREO_refport='#form.SREO_refport#', SREO_corpref='#form.SREO_corpref#', 
			</cfif> 
			<!--- Loop Through Selling Agents --->
			<cfif (form.list_type IS 3) OR (form.list_type IS 4)>
				<cfset number = 1>
				OB_firstname='#form.OB_firstname#', OB_lastname='#form.OB_lastname#', OB_compname='#form.OB_compname#',
				 OB_suite='#form.OB_suite#', OB_street='#form.OB_street#', OB_city='#form.OB_city#',
				OB_state='#form.OB_state#', OB_zip='#form.OB_zip#',	OB_phone='#form.OB_phone#', OB_fax='#form.OB_fax#',
				OB_email='#form.OB_email#', OB_contact='#form.OB_contact#',
				<cfset number_selling_agents = '#form.sell_agents#'>
				<cfset number = 1>
				<cfloop from="1" to="#number_selling_agents#" index="number">
				SREO#number#_Officenum='#Evaluate("form.SREO#number#_Officenum")#', SREO#number#_Paynum='#Evaluate("form.SREO#number#_Paynum")#',
				SREO#number#_firstname= '#Evaluate("form.SREO#number#_firstname")#', SREO#number#_lastname= '#Evaluate("form.SREO#number#_lastname")#', SREO#number#_assoport='#Evaluate("form.SREO#number#_assoport")#', 
				<cfset number = #number# + 1>				
				</cfloop>
				SREO_refport='#form.SREO_refport#', SREO_corpref='#form.SREO_corpref#', 
			</cfif>
				 status='#status#'
	WHERE	RecordID = #form.RecordID# 
	</cfquery>
	
	<!--- UPDATE QUERY PART TWO --->
	<cfquery name="UpdateRecordPartII" datasource="#gDSN#">
	UPDATE	tblForm203 
	SET		LRef_name='#form.LRef_name#', LRef_street='#form.LRef_street#', LRef_compname='#form.LRef_compname#', LRef_city='#form.LRef_city#',
			LRef_state='#form.LRef_state#', LRef_Zip='#form.LRef_zip#', LRef_num='#form.LRef_num#', 
			SRef_name='#form.SRef_name#', SRef_street='#form.SRef_street#', SRef_compname='#form.SRef_compname#', SRef_city='#form.SRef_city#',
			SRef_state='#form.SRef_state#', SRef_Zip='#form.SRef_zip#', SRef_num='#form.SRef_num#', 
			Agency_Broker_Listing='#form.Agency_Broker_Listing#', Agency_Broker_Sale='#form.Agency_Broker_Sale#',
			Agency_REO_Listing='#form.Agency_REO_Listing#', Agency_REO_Sale='#form.Agency_REO_Sale#',
			RESPA_Broker_Listing='#form.RESPA_Broker_Listing#', RESPA_Broker_Sale='#form.RESPA_Broker_Sale#',
			RESPA_REO_Listing='#form.RESPA_REO_Listing#', RESPA_REO_Sale='#form.RESPA_REO_Sale#',
			Seller_Broker_Listing='#form.Seller_Broker_Listing#', Seller_Broker_Sale='#form.Seller_Broker_Sale#',
			Seller_REO_Listing='#form.Seller_REO_Listing#', Seller_REO_Sale='#form.Seller_REO_Sale#',
			LeadPaint_Broker_Listing='#form.LeadPaint_Broker_Listing#', LeadPaint_Broker_Sale='#form.LeadPaint_Broker_Sale#',
			LeadPaint_REO_Listing='#form.LeadPaint_REO_Listing#', LeadPaint_REO_Sale='#form.LeadPaint_REO_Sale#',
			Buyer_Broker_Listing='#form.Buyer_Broker_Listing#', Buyer_Broker_Sale='#form.Buyer_Broker_Sale#',
			Buyer_REO_Listing='#form.Buyer_REO_Listing#', Buyer_REO_Sale='#form.Buyer_REO_Sale#',
			No_Listing_Agents='#form.list_agents#', No_Selling_Agents='#form.sell_agents#',
			Listing_Type='#form.list_type#', comments='#form.comments#', processedby='#form.processedby#',
			<cfif (FORM.Completed_Btn IS "Submit Completed/Updated Form")>
				date_submitted = '#form.date_processed#', process_month = '#process_month#',
			</cfif>
			date_processed='#form.date_processed#', Review_Flag='#Review_Flag_VALUE#', status='#status#' 
	WHERE	RecordID = #form.RecordID# 
	</CFQUERY>	
	<cfif status IS 'Incomplete'><cfset type = 'updated'></cfif>
	<cfif status IS 'Reviewed'><cfset type = 'reviewed and sent to accounting'></cfif>
	<cfif status IS 'Processed'><cfset type = 'processed'></cfif>
	<cfif status IS 'Revised'><cfset type = 'revised'></cfif>
	<cfif status IS 'Deal Off'><cfset type = 'deal off'></cfif>
	<cfif status IS 'Submitted'><cfset type = 'submitted to accounting'></cfif>
	<!--- <br><br><br><br> --->
	<cfoutput>
	<tr><td>
	<br>Record number #RecordID# of property address <b>#form.property_street#</b> is #type#.<br>
	Status of this record is #status# .	<br><br>
	  To view and print the text format of this record  <a href="ViewText.cfm?RecordID=#RecordID#" onClick="window.open('ViewText.cfm?RecordID=#RecordID#', 'newWin',  'scrollbars=yes'); return false">Click here</a><br><br> 
		<cfif status IS 'Reviewed'>
		Click on <a href="ViewNew.cfm">List</a> to review another record
	
		</cfif></td></tr>
		<cfset submit_type="Update">	<!--- ?UID=#session.UserID#&OID=#form.OID#&CID=#form.CID# --->
 	</cfoutput>	 
	
	<!--- end update --->
		
	
<cfelse>
	<cfquery name="InsertRecord" datasource="#gDSN#">
	INSERT INTO tblForm203 
			(Comp_ID, Office_ID, list_file_num, mls_num, exp_closeDate, seller_comp, seller_salutation, seller_firstname1, seller_lastname1, seller_firstname2, seller_lastname2, seller_street, seller_city, seller_state, seller_zip,
			seller_homephone, seller_workphone, seller_email, seller_emp_sales,  home_warranty, order_cont,  property_street, property_unit, property_city, property_state, property_zip,
			property_LDate, property_ADate, property_LPrice, property_SPrice, original_leasedate, exp_leasedate, lease_pmt, option_extend, option_purchase, option_price, tenant_email, tenant_phone, seller_source, buyer_source, past_title, style, financing, mortgage_co, mortgage_rep, mortgage_phone, mortgage_fax,
			buyer_comp, buyer_salutation, buyer_firstname1, buyer_lastname1, buyer_firstname2, buyer_lastname2,  buyer_street, buyer_unit, buyer_emp_sales, buyer_city, 
			buyer_state, buyer_zip,  buyer_email, buyer_homephone, buyer_workphone, gr_comm_percentage, gr_comm_dollars, <cfif (form.list_type IS 2)>
			REO_list_percentage, REO_list_dollars,	REO_sale_percentage, REO_sale_dollars,
			<cfelse>
			OB_percentage, OB_dollars, comp_percentage, comp_dollars,
			</cfif>
			list_percentage, list_dollars, sell_percentage, sell_dollars, 
			<cfif (form.list_type IS 1) OR (form.list_type IS 2) >
				<cfset number_listing_agents = '#form.list_agents#'>
				<cfset number = 1>
				<cfloop from="1" to="#number_listing_agents#" index="number">
				LREO#number#_Officenum, LREO#number#_Paynum, LREO#number#_firstname, LREO#number#_lastname, LREO#number#_assoport, 
				<cfset number = #number# + 1>				
				</cfloop>
				LREO_refport, LREO_corpref, 
			</cfif>
			<cfif (form.list_type IS 2) OR (form.list_type IS 3) OR (form.list_type IS 4)>
				<cfset number_selling_agents = '#form.sell_agents#'>
				<cfset number = 1>
				<cfloop from="1" to="#number_selling_agents#" index="number">
				SREO#number#_Officenum, SREO#number#_Paynum, SREO#number#_firstname, SREO#number#_lastname, SREO#number#_assoport, 
				<cfset number = #number# + 1>				
				</cfloop>
				SREO_refport, SREO_corpref, 
			</cfif>
			<cfif (form.list_type IS 3) OR (form.list_type IS 1) OR (form.list_type IS 4)>
				OB_firstname, OB_lastname, OB_num, OB_compname,  OB_suite, OB_street, OB_city, OB_state, OB_zip,
				OB_phone, OB_fax, OB_email, OB_contact,
			</cfif>
			LRef_name, LRef_street, LRef_city, LRef_state, LRef_Zip, LRef_num, LRef_compname,
			SRef_name, SRef_street, SRef_city, SRef_state, SRef_Zip, SRef_num, SRef_compname,
			Agency_Broker_Listing, Agency_Broker_Sale,Agency_REO_Listing, Agency_REO_Sale,
			RESPA_Broker_Listing, RESPA_Broker_Sale,RESPA_REO_Listing, RESPA_REO_Sale,
			Seller_Broker_Listing, Seller_Broker_Sale, Seller_REO_Listing, Seller_REO_Sale,
			LeadPaint_Broker_Listing, LeadPaint_Broker_Sale, LeadPaint_REO_Listing, LeadPaint_REO_Sale,
			Buyer_Broker_Listing, Buyer_Broker_Sale, Buyer_REO_Listing, Buyer_REO_Sale,  
			No_Listing_Agents, No_Selling_Agents, Listing_Type, comments, processedby,
			<cfif (FORM.Completed_Btn IS "Submit Completed/Updated Form")>
				date_submitted, process_month,
			</cfif>
			date_processed, status)
			
	VALUES  ('#form.CID#', '#form.OID#', '#form.list_file_num#', '#form.mls_num#', '#form.exp_closeDate#', '#form.seller_comp#', '#form.seller_salutation#', 
    '#form.seller_firstname1#', '#form.seller_lastname1#', '#form.seller_firstname2#',
    '#form.seller_lastname2#', '#form.seller_street#', '#form.seller_city#',
    '#form.seller_state#', '#form.seller_zip#'
			'#form.seller_homephone#', '#form.seller_workphone#', '#form.seller_email#', '#form.seller_emp_sales#',  '#form.home_warranty#', '#form.order_cont#',  '#form.property_street#', '#form.property_unit#', '#form.property_city#', '#form.property_state#', '#form.property_zip#',
			'#form.property_LDate#', '#form.property_ADate#', '#form.property_LPrice#', '#form.property_SPrice#', '#form.original_leasedate#', '#form.exp_leasedate#','#form.lease_pmt#',
 '#form.option_extend#','#form.option_purchase#','#form.option_price#','#form.tenant_email#',
  '#form.tenant_phone#', '#form.seller_source#', '#form.buyer_source#',           
    '#form.past_title#', '#form.style#', '#form.financing#', '#form.mortgage_co#', '#form.mortgage_rep#', '#form.mortgage_phone#', '#form.mortgage_fax#',
			'#form.buyer_comp#', '#form.buyer_salutation#', '#form.buyer_firstname1#', '#form.buyer_lastname1#', '#form.buyer_firstname2#', '#form.buyer_lastname2#',  '#form.buyer_street#', '#form.buyer_unit#', '#form.buyer_emp_sales#', '#form.buyer_city#', 
			'#form.buyer_state#', '#form.buyer_zip#',  '#form.buyer_email#', '#form.buyer_homephone#', '#form.buyer_workphone#', 
			'#form.gr_comm_percentage#', '#form.gr_comm_dollars#',
			<cfif (form.list_type IS 2)>
			'#form.REO_list_percentage#', '#form.REO_list_dollars#', '#form.REO_sale_percentage#', '#form.REO_sale_dollars#',
			<cfelse>
			'#form.OB_percentage#', '#form.OB_dollars#', '#form.comp_percentage#', '#form.comp_dollars#',
			</cfif>
			'#form.list_percentage#', '#form.list_dollars#', '#form.sell_percentage#', '#form.sell_dollars#', 
			<cfif (form.list_type IS 1) OR (form.list_type IS 2) >
				<cfset number_listing_agents = #form.list_agents#>
				<cfset number = 1>
				<cfloop from="1" to="#number_listing_agents#" index="number">
				'#Evaluate("form.LREO#number#_Officenum")#',  '#Evaluate("form.LREO#number#_Paynum")#', '#Evaluate("form.LREO#number#_firstname")#', '#Evaluate("form.LREO#number#_lastname")#', '#Evaluate("form.LREO#number#_assoport")#', 
				</cfloop>
				'#form.LREO_refport#', '#form.LREO_corpref#', 
			</cfif>
			<cfif (form.list_type IS 2) OR (form.list_type IS 3) OR (form.list_type IS 4) >
				<cfset number_selling_agents = #form.sell_agents#>
				<cfset number = 1>
				<cfloop from="1" to="#number_selling_agents#" index="number">
				'#Evaluate("form.SREO#number#_Officenum")#',  '#Evaluate("form.SREO#number#_Paynum")#', '#Evaluate("form.SREO#number#_firstname")#', '#Evaluate("form.SREO#number#_lastname")#', '#Evaluate("form.SREO#number#_assoport")#', 
				</cfloop>
				'#form.SREO_refport#', '#form.SREO_corpref#', 
			</cfif>
			<cfif (form.list_type IS 3) OR (form.list_type IS 1) OR (form.list_type IS 4)>
				'#form.OB_firstname#', '#form.OB_lastname#', '#form.OB_compname#',  '#form.OB_suite#', '#form.OB_street#', '#form.OB_city#', '#form.OB_state#', '#form.OB_zip#',
				'#form.OB_phone#', '#form.OB_fax#', '#form.OB_email#', '#form.OB_contact#',
			</cfif>
			'#form.LRef_name#', '#form.LRef_street#', '#form.LRef_city#', '#form.LRef_state#', '#form.LRef_Zip#', '#form.LRef_num#', '#form.LRef_compname#',
			'#form.SRef_name#', '#form.SRef_street#', '#form.SRef_city#', '#form.SRef_state#', '#form.SRef_Zip#', '#form.SRef_num#', '#form.SRef_compname#',
			'#form.Agency_Broker_Listing#', '#form.Agency_Broker_Sale#', '#form.Agency_REO_Listing#', '#form.Agency_REO_Sale#',
			'#form.RESPA_Broker_Listing#', '#form.RESPA_Broker_Sale#', '#form.RESPA_REO_Listing#', '#form.RESPA_REO_Sale#',
			'#form.Seller_Broker_Listing#', '#form.Seller_Broker_Sale#', '#form.Seller_REO_Listing#', '#form.Seller_REO_Sale#',
			'#form.LeadPaint_Broker_Listing#', '#form.LeadPaint_Broker_Sale#', '#form.LeadPaint_REO_Listing#', '#form.LeadPaint_REO_Sale#',
			'#form.Buyer_Broker_Listing#','#form.Buyer_Broker_Sale#', '#form.Buyer_REO_Listing#', '#form.Buyer_REO_Sale#', '#form.list_agents#', '#form.sell_agents#', '#form.list_type#', '#form.comments#', '#form.processedby#',
			<cfif (FORM.Completed_Btn IS "Submit Completed/Updated Form")>
				'#date_submitted_value#', '#process_month#',
			</cfif>
			'#form.date_processed#', '#status#')	
	
	</cfquery>
	
	<!--- get the RecordId of the new record for ViewText.cfm --->
	<cfquery datasource="#gDSN#" name="chkRecordNew">
		SELECT 	Max(RecordID) AS Last_Record
		FROM 	tblForm203
	</cfquery>
	
	<br><br><br><br>
	<cfoutput>
	<tr><td>	Listing with property address of <b>#form.property_street#</b> has been added to the database.<br>
		Status of this record is <b>#status# </b><br><br>
		
	</cfoutput>
	 	<cfset submit_type="New">
		To view and print the text format of this record <cfoutput><a href="ViewText.cfm?RecordID=#chkRecordNew.Last_Record#" onClick="window.open('ViewText.cfm?RecordID=#chkRecordNew.Last_Record#', 'newWin',  'scrollbars=yes'); return false">Click here</a><br><br>
	</cfoutput> 
	</td></tr>
</cfif>	
		
		
<!--- Get email address of sender --->
<cfquery datasource="#gDSN#" name="GetEmailAdd">
	SELECT *	FROM office		WHERE companyid='#form.CID#'  AND officeid='#form.OID#'
</cfquery>
<cfoutput query="GetEmailAdd">
	<cfset senderEmail = #GetEmailAdd.email#>
	<cfset office_id = #GetEmailAdd.officeID#>
</cfoutput>
 
<!--- set type for the mail --->
 
<cfif status IS 'Reviewed'><cfset type = 'reviewed and sent to accounting'></cfif>
<cfif status IS 'Processed'><cfset type = 'processed'></cfif>
<cfif status IS 'Revised'><cfset type = 'revised'></cfif>
<cfif status IS 'Deal Off'><cfset type = 'deal off'></cfif>
 
<!--- bcc="sparikh@realestateone.com" 203@realestateone.com--->
<!---if Reviewed, Revised or Deal-Off then Meredith/Commissions email To - sparikh@realestateone.com --->
<cfif (#status# IS 'Revised') OR (#status# IS 'Deal Off') >
	
	<cfmail FROM="#senderEmail#"
			TO="commissions@realestateone.com"
			SUBJECT="#status# Form203 from office number #form.OID#"
			
			type="HTML">
			<br><br>
		Form 203 for property address <b>#form.property_street#</b> is #type#, <br>
		please make a note of it.<br><br>
		
		Thank you,<br>
		FROM:<br>
		#form.processedby#
				
	</cfmail>
	<tr><td>
	<cfoutput>Form 203 property address <b>#form.property_street#</b> is submitted for processing.</cfoutput>
	</td></tr>
</cfif>
 
 <cfif #status# IS "Submitted" >
	<td><tr>
	<cfoutput>Form 203 for property address <b>#form.property_street#</b> is submitted to accounting.</cfoutput>
	</td></tr>
</cfif> 
 
 
 
<!--- send mail to other office if in-house deal and submitted to accounting --->
 
 <cfif (#status# IS "Submitted") AND (#form.list_type# IS '2')>
	<!--- get the RecordID, if it is new or an update from incomplete --->
	 <cfif parameterExists(form.RecordID)>
		<cfset rec_ID = #form.RecordID#>
	<cfelse>
		<cfset rec_ID = #chkRecordNew.Last_Record#>
	</cfif> 
	<cfloop from="1" to="#form.sell_agents#" index="number">
		<cfquery datasource="#gDSN#" name="GetREOAdd">
			SELECT *	FROM office		WHERE companyid='#form.CID#'  AND officeid='#Evaluate("form.SREO#number#_Officenum")#'
		</cfquery>
		<cfset email_to = '#GetREOAdd.email#'><!---sparikh@realestateone.com  --->
		<cfmail FROM="203@realestateone.com" 
			TO="#email_to#"
			SUBJECT="#status# Form203 from office number #form.oid#"
			type="HTML" >
			
			This record is submitted to accounting <br><br>
			
			Please click on the link below and print out the form for your records.<br>
			<a href="http://www.realestateone.net/MyWebLinks/203/ViewText.cfm?RecordID=#rec_ID#" onClick="window.open('ViewText.cfm?RecordID=#rec_ID#', 'newWin',  'scrollbars=yes'); return false">"http://www.realestateone.net/MyWebLinks/203/ViewText.cfm?RecordID=#rec_ID#"</a><br><br>
			Thank you,<br><br>
			
			Note: If the link above does not work by clicking on it, please copy the link and paste it in your browser's address bar.
			Thank you,<br><br>
			From:<br>
			#form.processedby#<br>
			Office No: #form.oid#
		</cfmail>
	</cfloop>
	<tr><td><cfoutput>An email has been sent to the Selling Agent's office regarding this record.<br></td></tr></cfoutput>
</cfif>	 

Open in new window

sometimes when you select * from a table, things get out of "alignment" if you add new columns to the table.   It can be necessary to give Coldfusion service a quick restart.

If all_listings_new is a view, then you need to recreate the view
Well, we know the causes of that type of sql error.  But we'd need to see a more detailed error message to help you pinpoint _where_ in the code the error's coming from.  Enable "Robust Debugging" in the CF Administrator.  Then CF will generate a more detailed error message .. including the page it occured on AND the malformed SQL statement (ie the query causing the error).  

There are a few queries in the newer code that might cause that error.  For example this one:

        <cfquery name="chkFlag" datasource="#gDSN#">
      SELECT Review_Flag      FROM tblForm203      
      WHERE  RecordID = #RecordID#
      </cfquery>

If for some reason the variable #RecordID# didn't exist, the sql sent to your db would be broken.  It might look like this:

      SELECT Review_Flag  FROM tblForm203      WHERE  RecordID =  

That's not valid sql.  The db expects a value after the record id, like "RecordID =  5".  

But we'd need to see a more detailed error message to tell you which query that error is coming from.
Avatar of jdines

ASKER

Hello,
  Here is the detailed error message:
Error Diagnostic Information
ODBC Error Code = 37000 (Syntax error or access violation)


[Microsoft][ODBC SQL Server Driver][SQL Server]Line 48: Incorrect syntax near ''.


SQL = "INSERT INTO tblForm203 (Comp_ID, Office_ID, list_file_num, mls_num, exp_closeDate, seller_comp, seller_salutation, seller_firstname1, seller_lastname1, seller_firstname2, seller_lastname2, seller_street, seller_city, seller_state, seller_zip, seller_homephone, seller_workphone, seller_email, seller_emp_sales, home_warranty, order_cont, property_street, property_unit, property_city, property_state, property_zip, property_LDate, property_ADate, property_LPrice, property_SPrice, original_leasedate, exp_leasedate, lease_pmt, option_extend, option_purchase, option_price, tenant_email, tenant_phone, seller_source, buyer_source, past_title, style, financing, mortgage_co, mortgage_rep, mortgage_phone, mortgage_fax, buyer_comp, buyer_salutation, buyer_firstname1, buyer_lastname1, buyer_firstname2, buyer_lastname2, buyer_street, buyer_unit, buyer_emp_sales, buyer_city, buyer_state, buyer_zip, buyer_email, buyer_homephone, buyer_workphone, gr_comm_percentage, gr_comm_dollars, REO_list_percentage, REO_list_dollars, REO_sale_percentage, REO_sale_dollars, list_percentage, list_dollars, sell_percentage, sell_dollars, LREO1_Officenum, LREO1_Paynum, LREO1_firstname, LREO1_lastname, LREO1_assoport, LREO_refport, LREO_corpref, SREO1_Officenum, SREO1_Paynum, SREO1_firstname, SREO1_lastname, SREO1_assoport, SREO_refport, SREO_corpref, LRef_name, LRef_street, LRef_city, LRef_state, LRef_Zip, LRef_num, LRef_compname, SRef_name, SRef_street, SRef_city, SRef_state, SRef_Zip, SRef_num, SRef_compname, Agency_Broker_Listing, Agency_Broker_Sale,Agency_REO_Listing, Agency_REO_Sale, RESPA_Broker_Listing, RESPA_Broker_Sale,RESPA_REO_Listing, RESPA_REO_Sale, Seller_Broker_Listing, Seller_Broker_Sale, Seller_REO_Listing, Seller_REO_Sale, LeadPaint_Broker_Listing, LeadPaint_Broker_Sale, LeadPaint_REO_Listing, LeadPaint_REO_Sale, Buyer_Broker_Listing, Buyer_Broker_Sale, Buyer_REO_Listing, Buyer_REO_Sale, No_Listing_Agents, No_Selling_Agents, Listing_Type, comments, processedby, date_submitted, process_month, date_processed, status) VALUES ('001', '5', '', '', '10/7/2009', 'reo', '', '', '', '', '', '1 fake', 'Southfield', 'MI', '48075' '', '', '', '0', '0', '0', '1 fake', '', 'Southfield', 'MI', '48075', '', '10/05/09', '100000', '100000', '10/5/2009', '10/5/2010','1000', 'y','y','10000','m@b.com', '111-111-1111', 'UNKNOWN', 'UNKNOWN', '0', 'None', 'Mortgage', '', '', '', '', 'c21', '', '', '', '', '', '2 made up', '', '0', 'Southfield', 'mi', '48000', 'm@g.com', '111-111-1111', '', '3', '', '3', '', '3', '', '', '', '', '', '1', '1111', 'michelle', 'jackson', '3%', '', '0', '2', '2', 'mic', 'jackson', '3%', '', '0', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0','0', '0', '0', '1', '1', '2', '', 'michelle Jackson', '10/05/09', 'October 2009', '10/05/09', 'Submitted')"

Data Source = "REO"


The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (437:2) to (437:50) in the template file D:\WEBSITES\WWWTEAMPORTALS\MYWEBLINKS\203\FORM_203_ACTION.CFM.


Date/Time: 10/05/09 20:49:14
Browser: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Remote Address: 76.9.124.2
HTTP Referrer: http://www.realestateone.net/MyWebLinks/203/form_203.cfm?form_type=new
could be those quotes at the very end ?

, '10/05/09', 'Submitted')"
                                     ^^^
ASKER CERTIFIED SOLUTION
Avatar of _agx_
_agx_
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
> could be those quotes at the very end ?

I'm not sure, but I don't think they're in the code. I think CF's just adding them to the error message.
agx is right,    here it is in the output..

.. 'Southfield','MI','48075''','',....

Btw, I don't understand why people insert ''  into varchar fields instead of NULL

SQL Server treats them differently, if you're testing for an empty field you have to test for either NULL or '' so you get both conditions, which means you have an OR or you are using isNULL or something.

I always replace '' with NULL so my empty columns are actually empty..
@gdemaria: neverending discussion about null vs. empty -
http://www.bennadel.com/index.cfm?dax=blog:85.view 
Wow, that certainly is quite a debate -
@eszaq - Well i think gdemaria's right ... because they share my opinion on NULL's ;-)
In that heated debate everybody has own opinion - that's why it's still on (0; I personally prefer an empty string as default. Storing empty values as NULL's adds a extra code and potential buggy behavior. Imagine query with use of sum() or concatination :
SELECT
  firstName + ' ' midInitial + ' ' +  lastName AS employeeName,
  annSalary + yrBonus AS totalPay
FROM tblEmployees

If you store emty values as NULL's... employees without end year bonus or without middle initial simply do not exist. We have to accout for being run over by a bus and cannot assume that each and every new developer to come will have a few years of DBA experience and will know to use ISNULL in every database query. Another thing, we are dealing with web applications. So, to pass NULL or empty string (or zero for numeric values) from the web form to the database - to cover "phylisophical" aspects of database design that some fight so fiercely - you'd need to have an extra form field (e.g radio-buttons no value/unknown value) otherwise empty string is passed when there's no value inside text input-field. But again there always will be cases when NULL is better. Development is a dirty job, but someone got to do it (0;
Avatar of jdines

ASKER

Thank you all for your assistance with this problem, as a new web develper your help has kept me sane...have a wonderful day.
> Development is a dirty job, but someone got to do it (0;

Well put ;-)