Two select statements on one table getting an error upon posting to table

Posted on 2011-10-21
Last Modified: 2012-05-12
  I need to run a query on a table that displays some information in a dropdown list and retrieves other information that will post to a new table upon submission.  Here is an example of what I am trying to accomplish:

                 Select LastName + ' ' + FirstName + ' ' + 'office ' + ' ' + Company AS Agent,Paynum,AssociateCell
              From tblUser
                   Where Inactive = '0' AND Role ='agent'
                    Order By LastName

When I try to post the data to a new table I get the following error:
Error Diagnostic Information
An error occurred while evaluating the expression:
Error near line 64, column 37.
Error resolving parameter FORM.ASSOCIATECELL
The specified form field cannot be found. This problem is very likely due to the fact that you have misspelled the form field name.

Below is the code on the submittion page
<cfquery name="addUser" datasource="HSO">
	Insert Into savings_card            			(FName1,LName1,FName2,LName2,Address,City,State,Zip,Email,Phone,TransType,Agent,AssociateCell,Affiliation,Rep,DateEntered)
       Value  ('#form.FirstName1#','#form.LastName1#''#form.FirstName2#',

Open in new window

Question by:jdines
    LVL 16

    Expert Comment

    First please confirm that you have check the spell including case (I notice that there is no consistency in the format of your control names, some start with capital some start with small letter).

    Also make sure that the data type that you are entering in the form is an accepted data type in the table field
    LVL 16

    Accepted Solution

    Also does the code work when you remove '#form.AssociateCell#'

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
    The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
    Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
    Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now