Hi,
Can anyone tell me how I may use the value of a field obtained from a query
in a template as a valid variable, as I keep getting "unknown parameter"
error.
The following is the code I'm using at the moment.
I tried to put <cfparam name="SubVid" default=""> in Application.cfm,
the result was that the resulting VID value would be = [blank +
#evaluate(expression)#]
e.g. [blank 2]

here is the code I'm using.

<CFQUERY Name="SearchByID" DATASOURCE="vacancy">
SELECT     land_id
FROM     VacancyDetails
</CFQUERY>
<!--- Uses ListValueCount to see how many
records belong to the given Landlord / id --->
<H3>ListValueCount for ID Generation</H3>

<FORM ACTION="list2.cfm" METHOD="POST">

<P>Please enter your user ID:<BR>
<INPUT TYPE="Text" NAME="land_id" SIZE="20">
<P>
<INPUT TYPE="Submit" NAME="Submit" VALUE="Search Vacancy Table">
</FORM>

<!--- wait to have a string for searching defined --->
<CFIF IsDefined("FORM.Submit") and IsDefined("FORM.land_id")>
<cfset Land = #land_id# >
<CFSET myList = ValueList(SearchByID.land_id)>
<CFSET numberOfVacancies = ListValueCount(myList,
FORM.land_id)>

<CFIF numberOfVacancies  gt 0>
<!--- Get any SubVid value from any record as they all have the same field
value, where Land_id field
is equal to the one given by the form input --->
<CFQUERY Name="SearchBySubVid" DATASOURCE="vacancy">
SELECT    SubVid
FROM     VacancyDetails
where   land_id='#form.land_id#'
</CFQUERY>
<!--- Set SV equal to the value of SubVid retrieved from the
'SearchBySubVid' query  --->
<cfset SV = #subvid#>

<cfoutput><br>SubVid  Value= #SV# </cfoutput>
<cfset expression = "#numberOfVacancies# + increment">
<cfset increment = 1>

<cfset vid = #SV# & #evaluate(expression)#>

<cfoutput>The new Vacancy ID is the combination of subvid value
and the number generated in 'evaluate(expression)' function
hence = : #vid#</cfoutput>


</CFIF>
</CFIF>


-----------------------------------------------
FREE! The World's Best Email Address @email.com
Reserve your name now at http://www.email.com


------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to